zoukankan      html  css  js  c++  java
  • 百度地图坐标显示隐藏

    <div id="l-map"></div>
        <div id="r-result">
            <input type="button" onclick="showOver()" value="显示" />
            <input type="button" onclick="hideOver()" value="隐藏" />
        </div>
    View Code
    var map = new BMap.Map("l-map");
        var point = new BMap.Point(116.404, 39.915);
        map.centerAndZoom(point, 15);
        
        var marker = new BMap.Marker(new BMap.Point(116.404, 39.915));  // 创建标注
        map.addOverlay(marker);              // 将标注添加到地图中
        
        var polyline = new BMap.Polyline([
            new BMap.Point(116.399, 39.910),
            new BMap.Point(116.405, 39.920),
            new BMap.Point(116.425, 39.900)
        ], {strokeColor:"blue", strokeWeight:6, strokeOpacity:0.5});
        map.addOverlay(polyline);          //增加折线
        
        var circle = new BMap.Circle(point,500);
        map.addOverlay(circle);            //增加圆
        hideOver();
        
        function showOver(){
            marker.show(); polyline.show(); circle.show();
        }
        function hideOver(){
            marker.hide(); polyline.hide(); circle.hide();
        }
    View Code
  • 相关阅读:
    ES6
    ES6
    ES6
    ES6
    ES6
    ES6
    ES6
    IOS 最新开发上架流程 以及发布打包注意事项
    JavaScript Arguments
    函数防抖和函数节流
  • 原文地址:https://www.cnblogs.com/acmyun/p/12052767.html
Copyright © 2011-2022 走看看