如何监听cesium terrain的load事件?
How to listen the load event of cesium terrain?
let map = new Cesium.Viewer('map-3d');
const terrainProvider = new Cesium.CesiumTerrainProvider({
url: 'http://59.48.1xxxx/xxx',
})
map.terrainProvider = terrainProvider
问题如下:
如何监听“terrainProvider”是否开始加载数据?
viewer.scene.globe.tileLoadProgressEvent.addEventListener(function (queuedTileCount) {
console.log(queuedTileCount);
console.log(viewer.scene.globe.tilesLoaded);
if(viewer.scene.globe.tilesLoaded){
}
});
let map = new Cesium.Viewer('map-3d');
const terrainProvider = new Cesium.CesiumTerrainProvider({
url: 'http://59.48.1xxxx/xxx',
})
map.terrainProvider = terrainProvider
问题如下:
如何监听“terrainProvider”是否开始加载数据?
viewer.scene.globe.tileLoadProgressEvent.addEventListener(function (queuedTileCount) {
console.log(queuedTileCount);
console.log(viewer.scene.globe.tilesLoaded);
if(viewer.scene.globe.tilesLoaded){
}
});