leaflet应用wms加载geoserver地图切片,
1. wms加载geoserver地图切片
setTimeout(() => {
const bounderLayer =L.tileLayer.wms("url", {
layers: layerName,
format: "image/png",
transparent: true
});
bounderLayer.addTo(map)
},1000);
代码中url是要访问的geoserver的url,到/wms
layers是访问的geoserver的图层名称
2. leaflet 应用esri.dynamicMapLayer加载arcgis的切片
var envLayer = L.esri.dynamicMapLayer({
url: "",
//opacity: 0.5,
transparent: true,
//layers: [0,2]
});
this.leafletService.map.addLayer(envLayer);
url是发布的arcgis的切片名称,到/MapServer
opacity是透明度,
layers是要加载的层,如果不需要指定特定的层就不用layers属性
转载自:https://blog.csdn.net/qq_34790644/article/details/81976957