https://blog.csdn.net/qq_36061522/article/details/81233981
https://blog.csdn.net/qq_37638969/article/details/107131464
https://cesium.com/learn/cesiumjs/ref-doc/EventHelper.html?classFilter=EventHelper#add
// 點擊事件 handler.setInputAction(function (click) { var pick = viewer.scene.pick(click.position) if (Cesium.defined(pick)) { console.log(pick.id.id, pick.id.name) } }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
// 滾動事件 handler.setInputAction(function(wheelment) { console.log(wheelment) }, Cesium.ScreenSpaceEventType.WHEEL)
// 事件解除 handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK)
// 相機移動結束事件 viewer.scene.camera.moveEnd.addEventListener(function(e) { //獲取當前相機高度 const height = Math.ceil(earth.camera.positionCartographic.height) console.log(e, height) })
// onload var helper = new Cesium.EventHelper() const RemoveCallback = helper.add(viewer.scene.globe.tileLoadProgressEvent, function(event) { if (event == 0) { console.log('onload') // 刪除事件監聽 RemoveCallback() } })