一锅小青蛙 2016-09-21 02:54 采纳率: 50%
浏览 2831

百度地图鼠标绘制工具条 scale问题

原封不动地照搬了百度绘制工具条的demo源代码,单当我加了一条scale:0.8,工具条的ui就变得模糊了,这是怎么回事?

 <script type="text/javascript">
        // 百度地图API功能
        var map = new BMap.Map('baiduMap');
        var poi = new BMap.Point(116.307852, 40.057031);
        map.centerAndZoom(poi, 16);
        map.enableScrollWheelZoom();
        var overlays = [];
        var overlaycomplete = function (e) {
            clearAll();
            overlays.push(e.overlay);
        };
        var styleOptions = {
            strokeColor: "red",    //边线颜色。
            //fillColor: "red",      //填充颜色。当参数为空时,圆形将没有填充效果。
            strokeWeight: 3,       //边线的宽度,以像素为单位。
            strokeOpacity: 0.8,    //边线透明度,取值范围0 - 1。
            fillOpacity: 0.6,      //填充的透明度,取值范围0 - 1。
            strokeStyle: 'solid' //边线的样式,solid或dashed。
        }
        //实例化鼠标绘制工具
        var drawingManager = new BMapLib.DrawingManager(map, {
            isOpen: false, //是否开启绘制模式
            enableDrawingTool: true, //是否显示工具栏
            drawingToolOptions: {
                anchor: BMAP_ANCHOR_TOP_LEFT, //位置
                offset: new BMap.Size(100, 5), //偏离值
                                scale:0.8,
                drawingModes: [BMAP_DRAWING_CIRCLE,BMAP_DRAWING_RECTANGLE, BMAP_DRAWING_POLYGON]
            },
            circleOptions: styleOptions, //圆的样式
            polylineOptions: styleOptions, //线的样式
            polygonOptions: styleOptions, //多边形的样式
            rectangleOptions: styleOptions //矩形的样式
        });
        //添加鼠标绘制工具监听事件,用于获取绘制结果
        drawingManager.addEventListener('overlaycomplete', overlaycomplete);
        function clearAll() {
            for (var i = 0; i < overlays.length; i++) {
                map.removeOverlay(overlays[i]);
            }
            overlays.length = 0
        }
</script>

图片说明

  • 写回答

2条回答

  • zqbnqsdsmd 2016-09-27 17:05
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64
  • ¥15 iOS 自定义输入法-第三方输入法
  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
  • ¥15 怀疑手机被监控,请问怎么解决和防止