使用产品:iclient 3d for webGL 问题详细描述:webGL开发坡度坡向功能,报错 cannot read property 'generateBuffer' of undefined 问题重现步骤: 在 viewer.scene.globe.SlopeSetting = { slopeSetting : slope, analysisMode : wide };语句中报错 cannot read property 'generateBuffer' of undefined
var slope = new Cesium.SlopeSetting(); slope.DisplayMode = Cesium.SlopeSettingEnum.DisplayMode.FACE_AND_ARROW; slope.MaxVisibleValue =78; slope.MinVisibleValue =0; var colorTable = new Cesium.ColorTable(); colorTable.insert(0, new Cesium.Color(255/255, 0/255, 0/255)); colorTable.insert(20, new Cesium.Color(221/255, 224/255, 7/255)); colorTable.insert(30, new Cesium.Color(20/255, 187/255, 18/255)); colorTable.insert(50, new Cesium.Color(0, 161/255, 1)); colorTable.insert(80, new Cesium.Color(9/255, 9/255, 255/255)); slope.colorTable=colorTable; var array = [].concat(result.object.positions); var positions = []; for(var i = 0, len = array.length; i < len; i ++){ var cartographic = Cesium.Cartographic.fromCartesian(array[i]); var longitude = Cesium.Math.toDegrees(cartographic.longitude); var latitude = Cesium.Math.toDegrees(cartographic.latitude); var h=cartographic.height; if(positions.indexOf(longitude)==-1&&positions.indexOf(latitude)==-1){ positions.push(longitude); positions.push(latitude); positions.push(h); } } slope.CoverageArea = positions; slope.updateColorDictTable=true; _this.viewer.scene.globe.SlopeSetting = { slopeSetting : slope, analysisMode : 1, };