Vue2leaflet 替换国内地图api,带{z}/{x}/{y}形式的

参考:https://www.cnblogs.com/gispathfinder/p/9535685.html

Vue2leaflet安装后,默认自带的地图URL如下

url:'http://{s}.tile.osm.org/{z}/{x}/{y}.png'
return {
      zoom: 8,
      center: L.latLng(31.87, 120.55 ),  //张家港市地理经纬度
      url:'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
      attribution: '© <a href="http://osm.org/copyright">Vue2leaflet</a> contributors',
      withPopup: L.latLng(31.87, 120.55),  
      withTooltip: L.latLng(31.38, 120.98 ),//苏州市昆山市地理经纬度
      currentZoom: 11.5,
      currentCenter: L.latLng(31.87, 120.55 ),
      showParagraph: false,
      mapOptions: {
        zoomSnap: 0.5
      }
    };

  调用国内地图的URL:

高德:http://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}

 

posted @ 2019-04-23 15:52  阴翳公子  阅读(1742)  评论(0编辑  收藏  举报