参考博主
功能代码参考
新需求:点击测距,此时画线逻辑已生成到运行缓存中,如果 用户误触测距,想撤销,如何操作?
代码:
// 重置画图
resetDraw(){
// 清除可能会用到的监听事件
if (this.handler) {
this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
this.handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
this.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK);
}
},