我是直接自己在官网复现测试过得,感觉这个bug有点严重直接会导致卡死有点可怕,完整得步骤过程见注释。
https://www.supermapol.com/webgl/examples/webgl/editor.html#viewshed3D
<button type="button" id="clearLine" class="button black">清除线条</button>
//1.绘制线条(代码运行添加)
//2.绘制可视域(绘制可视域需要压盖线条)
//3.点击清除线条
//4.点击清除可视域出现卡死
let lineEntity =viewer.entities.add({
polyline: {
positions: SuperMap3D.Cartesian3.fromDegreesArray([116.44768006375261,39.90695837418782,116.44768006375261,39.10695837418782]),
width: 5, // 线条宽度
material: new SuperMap3D.PolylineOutlineMaterialProperty({
color: SuperMap3D.Color.fromCssColorString('rgba(250, 196, 65, 1)'),
outlineColor: SuperMap3D.Color.fromCssColorString('rgba(29, 206, 200, 1)'),
outlineWidth: 3, // 边框宽度
}),
clampToGround:true,//设置线条贴地
}
});
$("#clearLine").on("click", function () {
viewer.entities.remove(lineEntity)
})