How to listen the load event of cesium terrain?

1.1k Views Asked by At
let map = new Cesium.Viewer('map-3d');

const terrainProvider = new Cesium.CesiumTerrainProvider({
    url: 'http://59.48.1xxxx/xxx',
})

map.terrainProvider = terrainProvider

Here's the question:

how to listen "terrainProvider" whether it begin the load of data?

1

There are 1 best solutions below

6
On BEST ANSWER
viewer.scene.globe.tileLoadProgressEvent.addEventListener(function (queuedTileCount) {
    console.log(queuedTileCount);
    console.log(viewer.scene.globe.tilesLoaded);

    if(viewer.scene.globe.tilesLoaded){
        
    }
});