一、geowebcache.xml文件配置
<arcgisLayer> <name>ArcGISCache</name> <tilingScheme>I:9000_GISgisdata-cacheArcGISCacheLayersconf.xml</tilingScheme> <tileCachePath>I:9000_GISgisdata-cacheArcGISCacheLayers\_alllayers</tileCachePath> <hexZoom>false</hexZoom> </arcgisLayer> <wmsLayer> <name>ChinaCityLatLon</name> <mimeFormats> <string>image/gif</string> <string>image/jpeg</string> <string>image/png</string> <string>image/png8</string> </mimeFormats> <wmsUrl> <string>http://192.168.198.252:8080/geoserver/demo/wms</string> </wmsUrl> <wmsLayers>demo:ChinaCityLatLon</wmsLayers> </wmsLayer>
二、配置说明
ArcGISCache:ArcGIS瓦片目录
ChinaCityLatLon:其他GeoServer服务,通过gwc进行缓存托管,如全部下载之后,可以脱离那台GeoServer服务
三、Leaflet测试代码
L.tileLayer.wms("http://127.0.0.1:5430/geoserver/gwc/service/wms", {
layers: 'ArcGISCache',
format: 'image/png',
transparent: true,
noWrap: true
}).addTo(m);
const url2 = 'http://127.0.0.1:5430/geoserver/gwc/service/wmts/';
const dem_tile = new L.TileLayer.WMTS(url2, {
layer: 'ChinaCityLatLon',
tilematrixSet: 'EPSG:900913',
format: 'image/png'
})
dem_tile.addTo(m)
四、具体效果