使用产品:iserver-11.0.1 操作系统:win11 x64
数据类型: pgsql数据库型工作空间
问题详细描述:我想在原生cesium上加载地图服务,现在能成功加载,但是是转换成地图切片了,加载速度很慢,想问一下怎么修改代码能够更快速的加载呢,比如不用切片的方式
addSuperMapLayer(url) {
//this.clearAllEntitys();
fetch(url + ".rjson?token=" + this.token)
.then((response) => response.json())
.then((result) => {
const epsgCode = result.prjCoordSys.epsgCode;
const rectangle = Cesium.Rectangle.fromDegrees(-180, -90, 180, 90);
let tilingScheme;
let originx, originy;
let minLevel = 0;
let maxLevel = 22;
if (epsgCode === 4326) {
tilingScheme = new Cesium.GeographicTilingScheme({
numberOfLevelZeroTilesX: 2,
numberOfLevelZeroTilesY: 1,
});
originx = -180;
originy = 90;
} else if (epsgCode === 3857) {
tilingScheme = new Cesium.WebMercatorTilingScheme();
originx = -20037508.34;
originy = 20037508.34;
}
const layerProvider = new Cesium.UrlTemplateImageryProvider({
url:
url +
"/tileImage.png?token=" +
this.token +
"&transparent=true&cacheEnabled=true&width=256&height=256&x={x}&y={y}&scale={scale}&redirect=false&overlapDisplayed=false&origin={'x':" +
originx +
",'y':" +
originy +
"}",
rectangle: rectangle,
minimumLevel: minLevel,
maximumLevel: maxLevel,
tilingScheme: tilingScheme,
customTags: {
scale: (imageryProvider, x, y, level) => {
return epsgCode === 4326
? this.scales84[level]
: this.scalesWeb[level];
},
},
});
window.viewer.imageryLayers.addImageryProvider(layerProvider);
})
.catch((error) => {
console.error("Error loading SuperMap layer:", error);
});
}, scales84: [
3.38032714321e-9, 6.76065428641e-9, 1.352130857282e-8,
2.704261714564e-8, 5.408523429128e-8, 1.0817046858257e-7,
2.1634093716514e-7, 4.3268187433028e-7, 8.6536374866056e-7,
1.73072749732112e-6, 3.46145499464224e-6, 6.92290998928448e-6,
1.3845819978568952e-5, 2.7691639957137904e-5, 5.538327991427581e-5,
1.1076655982855162e-4, 2.2153311965710323e-4, 4.4306623931420646e-4,
8.861324786284129e-4, 0.0017722649572568258, 0.0035445299145136517,
0.007089059829027303,
],
scalesWeb: [
1.6901635716e-9, 3.38032714321e-9, 6.76065428641e-9, 1.352130857282e-8,
2.704261714564e-8, 5.408523429128e-8, 1.0817046858257e-7,
2.1634093716514e-7, 4.3268187433028e-7, 8.6536374866056e-7,
1.73072749732112e-6, 3.46145499464224e-6, 6.92290998928448e-6,
1.3845819978568952e-5, 2.7691639957137904e-5, 5.538327991427581e-5,
1.1076655982855162e-4, 2.2153311965710323e-4, 4.4306623931420646e-4,
8.861324786284129e-4, 0.0017722649572568258, 0.0035445299145136517,
0.007089059829027303,
],