标签:geo option UNC center prototype 适配 arcgis lse comm
1、继承L.TileLayer的新类arcgisTiledLayer
L.TileLayer.ArcgisTiledLayer = L.TileLayer.extend({ initialize: function (url, options) { L.TileLayer.prototype.initialize.call(this, url + "/tile/{z}/{y}/{x}", options); } }); L.tileLayer.arcgisTiledLayer = function (url, options) { return new L.TileLayer.ArcgisTiledLayer(url, options); };
2、前端调用方法
var layer1 = L.tileLayer.arcgisTiledLayer(‘http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer‘, { maxZoom: 12, minZoom: 4 }); var map = L.map("map", { center: [31.59, 120.29], zoom: 5, layers: [layer1], zoomControl: false });
leaflet:改造继承L.TileLayer类适配arcgis切片地图
标签:geo option UNC center prototype 适配 arcgis lse comm
原文地址:https://www.cnblogs.com/tiandi/p/9734488.html