遇到问题:
①加载瓦片服务时,发现{TileRow}/{TileCol} 参数不对,刚好是等级大了一倍;
解决方法:tileMatrixLabels:["1","2","3","4","5","6","7","8","9","10","11"] ,注意是从1开始,不是从0开始。
加载wmts 主要代码如下:
var image = new Cesium.WebMapTileServiceImageryProvider({ url:"http://localhost:8880/geoserver/gwc/service/wmts/rest/arctest/{style}/{TileMatrixSet}/EPSG:4490_arctest:{TileMatrix}/{TileRow}/{TileCol}?format=image/png", layer:'arctest', format: "image/png", style:'default', tileMatrixSetID: 'EPSG:4490_arctest', tileMatrixLabels:["1","2","3","4","5","6","7","8","9","10","11"], tilingScheme:new Cesium.GeographicTilingScheme({ numberOfLevelZeroTilesX: 2, numberOfLevelZeroTilesY: 1, }), }); //layer、tileMatrixSetID等参数需要根据自己的geoserver来做设置 localhost:8880/geoserver/gwc/service/wmts?REQUEST=getcapabilities,这里是所有wmts服务的参数列表,找到对应的图层配置即可 //添加到图层列表 viewer.imageryLayers.addImageryProvider(image); 标签:layer,image,arctest,wmts,geoserver,cesium,加载 From: https://www.cnblogs.com/hjyjack9563-bk/p/17541407.html