cesium加载iserver发布的wmts-100服务请求很多报400;并且瓦片数据没有加载出来,请大神帮忙看下是什么问题呢?
代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>OGC:WMTS服务</title>
<!--Cesium.js和widgets.css文件在WebGL开发包内,请到开发者中心下载-->
<link href="../../../thirdparty/Cesium/Widgets/widgets.css" rel="stylesheet">
<script src="../../../thirdparty/Cesium/Cesium.js"></script>
<style>
html, body,
#cesiumContainer {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
</style>
</head>
<body>
<div id="cesiumContainer"></div>
<script>
function onload(Cesium) {
// 加载token, 需要在构造图层provider前声明
Cesium.Credential.CREDENTIAL = new Cesium.Credential("ff80808182c419760182c8ad1b8a0002", "token");
// 初始化viewer部件
let viewer = new Cesium.Viewer('cesiumContainer');
let imageryLayers = viewer.imageryLayers;
// 添加SuperMap iServer发布的WTMS服务
let provider_mec = new Cesium.WebMapTileServiceImageryProvider({
url: "http://10.91.6.19:8884/gtis/map/wmts/3f21010023594920a1e9c238a8cae1f1",
layer: "0.5米全市域影像20210218",
style: "default",
format: "image/png",
tileMatrixSetID: "Custom_0.5米全市域影像20210218",
tileMatrixLabels: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"],
tilingScheme: new Cesium.GeographicTilingScheme(),
});
imageryLayers.addImageryProvider(provider_mec);
// 设置相机视角
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(111.7682280085,32.40491736760001, 1000)
});
}
if (typeof Cesium !== 'undefined') {
onload(Cesium);
}
</script>
</body>
</html>