使用产品:SuperMap_iClient3D_9D_for_WebGL_1901211048 操作系统:win10 x64
数据类型: 三维倾斜模型
问题详细描述:在做淹没分析的时候,对图层分层设色属性进行设置,但一直报错!使用时是在vue框架下进行。代码如下:
floodAnalysis() {
var viewer = this.viewer;
var Cesium = this.Cesium;
var demLayer = viewer.scene.layers.find("DemDataset");
var layer = viewer.scene.layers
var hyp = new Cesium.HypsometricSetting();
//创建分层设色对象 设置最大/最小可见高度 颜色表 显示模式 透明度及线宽
var colorTable = new Cesium.ColorTable();
hyp.MaxVisibleValue = this.currentHeight;
hyp.MinVisibleValue = 797.551678;
colorTable.insert(71, new Cesium.Color(0, 39 / 255, 148 / 255));
colorTable.insert(0, new Cesium.Color(149 / 255, 232 / 255, 249 / 255));
hyp.ColorTable = colorTable;
hyp.DisplayMode = Cesium.HypsometricSettingEnum.DisplayMode.FACE;
hyp.Opacity = 0.5;
hyp.LineInterval = 10.0;
//设置图层分层设色属性
demLayer.hypsometricSetting = {
analysisMode: Cesium.HypsometricSettingEnum.AnalysisRegionMode.ARM_ALL,
hypsometricSetting: hyp,
};
报错:
VM1973:1 Uncaught TypeError: Cannot read property '0' of undefined
at u.generateBuffer (eval at <anonymous> (Cesium.js:25), <anonymous>:1:437078)
at Ct.set (eval at <anonymous> (Cesium.js:25), <anonymous>:1:2663772)
at CesiumOperate.floodAnalysis (CesiumOperate.js?2f94:158)
at eval (CesiumMap.vue?2978:281)