在GeoServer欢迎页面中,在右侧有服务能力列表
点击 WMTS,查看发布的WMTS服务列表
如果遇到如下情况,则需要重新载入列表:
在 Caching Defaults 下,打开GWC的主页
点击 A list of all the layers and automatic demos
在最下面,点击 Reload TileLayerConfiguration
重新读取后,就能显示WMTS的服务列表啦
是这样滴:
在该图层的最下面有WMTS的REST 方式的 url
使用Cesium 的WebMapTileServiceImageryProvider 函数加载WMTS影像
var smart = new Cesium.WebMapTileServiceImageryProvider({
url : 'http://localhost:5080/geoserver/gwc/service/wmts/rest/xxx:lll/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}?format=image/png',
layer : 'xxx:lll',
style : '',
format : 'image/png',
tileMatrixSetID : 'EPSG:4326',
maximumLevel: 20
})
Cesium调用 ArcGIS Server 以及 GeoServer 发布的地图服务
https://blog.csdn.net/weixin_40161953/article/details/80971167
Cesium调用geoserver2.14发布的WMTS瓦片
https://blog.csdn.net/Coveragehe/article/details/88369314?utm_source=app
http://localhost:5080/geoserver/gwc/service/wmts/rest/xxx:lll/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}?format=image/png
var smart = new Cesium.WebMapTileServiceImageryProvider({
url : 'http://localhost:5080/geoserver/gwc/service/wmts/rest/xxx:lll/{style}/{TileMatrixSet}/{TileMatrixSet}:{TileMatrix}/{TileRow}/{TileCol}?format=image/png',
layer : 'xxx:lll',
style : '',
format : 'image/png',
tileMatrixSetID : 'EPSG:4326',
tileMatrixLabels : ['EPSG:4326:0', 'EPSG:4326:1', 'EPSG:4326:2' ...],
maximumLevel: 20
})
let viewer = new Cesium.Viewer('cesiumContainer', {
scene3DOnly: true,
timeline: false,
animation: false,
vrButton: false,
baseLayerPicker: true,
infoBox: true,
credtiContainer: 'credit',
fullscreenButton: false
})
// cesium 下方介绍等
viewer._cesiumWidget._creditContainer.style.display = "none"
viewer.baseLayerPicker.viewModel.selectedImagery = viewer.baseLayerPicker.viewModel.imageryProviderViewModels[3]
// Example 2. USGS shaded relief tiles (RESTful)
var smart = new Cesium.WebMapTileServiceImageryProvider({
url : 'http://localhost:5080/geoserver/gwc/service/wmts/rest/xxx:lll/{style}/{TileMatrixSet}/{TileMatrixSet}:{TileMatrix}/{TileRow}/{TileCol}?format=image/png',
layer : 'xxx:lll',
style : '',
format : 'image/png',
tileMatrixSetID : 'EPSG:900913',
maximumLevel: 20
})
viewer.imageryLayers.addImageryProvider(smart)
viewer.camera.flyTo({ //设置视角
destination: Cesium.Cartesian3.fromDegrees(114.5915, 36.6551, 100)
})
此篇记录研究过程,如有错误,欢迎指出。