Cesium如何加载PBS发布的WMTS服务

发布时间 2023-04-13 12:31:00作者: 一飞秒的爱

Cesium加载Geoserver发布的WMTS服务,url示例:

'http://localhost:8080/geoserver/gwc/service/wmts/rest/nurc:mosaic/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}?format=image/png',
而PBS(PortableBasemapServer)发布的地址是这样:
http://192.168.58.1:7080/PBS/rest/services/cngooglemap/MapServer/WMTS
在Cesium中使用时可以通过TMS形式加载即UrlTemplateImageryProvider,url改写为:
http://192.168.58.1:7080/PBS/rest/services/cngooglemap/MapServer/WMTS/tile/1.0.0/cngooglemap/default/GoogleMapsCompatible/{z}/{reverseY}/{x}.jpg
注意这里反向的写法是reverseY而不是-y