zl程序教程

您现在的位置是:首页 >  后端

当前栏目

【GIS】GeoServer、GeoWebCache发布ArcGIS瓦片集成测试(2.15.4)

集成测试 发布 ArcGIS GIS GeoServer 瓦片
2023-09-11 14:17:09 时间

一、geowebcache.xml文件配置

    <arcgisLayer> 
      <name>ArcGISCache</name> 
      <tilingScheme>I:\9000_GIS\gisdata-cache\ArcGISCache\Layers\conf.xml</tilingScheme> 
      <tileCachePath>I:\9000_GIS\gisdata-cache\ArcGISCache\Layers\_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)

四、具体效果