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() } })

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM