首页 / 浏览问题 / 三维GIS / 问题详情
supermap iclient3d for cesium中s3mTileLayer.coverImageLayer问题
jzl
1EXP 2024年03月04日

在项目中加载倾斜摄影和专题图,想要专题图覆盖在倾斜摄影表面

promise.then(s3mLayer => {
            const imageryLayers = that.scene.imageryLayers._layers
            if (Array.isArray(s3mLayer)) {
                s3mLayer.forEach(el => {
                    el.coverImageryLayer = imageryLayers.filter(item => item.layerName !== '影像地图')
                })
            } else {
                s3mLayer.coverImageryLayer = imageryLayers.filter(item => item.layerName !== '影像地图')
            }
        })

这个是在加载倾斜摄影之后的代码,上面的方式可行(是先加载专题图,再加载倾斜摄影)

但是如果先加载倾斜摄影,再加载专题图

if (this.scene.layers.layerQueue.length > 0) {

        this.scene.layers.layerQueue.forEach((item) => {

          item.coverImageryLayer = this.scene.imageryLayers._layers.filter((item) => item.layerName !== '影像地图' && item.layerName !== '高分辨率影像地图')

        })

      }

使用上面的代码系统就会报错卡死

2 个回答

您好

图层层级本身就是会影响数据加载的顺序

甚至某些图层如果顺序错误就会出现崩溃线下
4,151EXP 2024年03月04日
您好,感觉有可能是您的倾斜图层还没有加载完就调用coverImageryLayer 导致的问题。建议可以在加载完倾斜的回调里面去添加专题图。

希望可以帮助到您!
2,513EXP 2024年04月11日
...