Cesium 事件监听 onload 加载完成 点击事件

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() } })
原文地址:https://www.cnblogs.com/CyLee/p/15543738.html