想要在只定义一个url的情况下,实现多个iClient for Leaflet的功能,比如矢量瓦片和图层显隐性控制这两个功能,但是代码里面这两种map的定义方式是不一样的,矢量瓦片是这样的:
var host = "http://127.0.0.1:8090";
var map, selectId, selectLayerName, vectorLayer,
url = host+"/iserver/services/map-tm100/rest/maps/vec@天地图";
map = L.map('map', {
center: {lon: 119.40, lat: 30.36},
crs: L.CRS.EPSG4326,
maxZoom: 15,
zoom:11
});
图层控制的定义方式是这样的:
var map;
var layer;
var url ;
var tempLayerID ,
host = document.location.toString().match(/file:\/\//)?"http://127.0.0.1:8090":'http://' + document.location.host,
url =host+"/iserver/services/map-tm100/rest/maps/vec@天地图";
这两种定义方式有什么不同吗