1
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?

moshfiqrony
  • 4,303
  • 2
  • 20
  • 29
Dreams
  • 23
  • 2

1 Answers1

2
viewer.scene.globe.tileLoadProgressEvent.addEventListener(function (queuedTileCount) {
    console.log(queuedTileCount);
    console.log(viewer.scene.globe.tilesLoaded);

    if(viewer.scene.globe.tilesLoaded){
        
    }
});
ZhefengJin
  • 930
  • 8
  • 17
  • thank you, CesiumTerrainProvider few occurrences do not request Terrain problem, do you know how to solve it? My original intention was to try to reload by listening for the above event – Dreams Jun 08 '21 at 08:41
  • Need to see your custom code to check why that happens. – ZhefengJin Jun 08 '21 at 09:29
  • I found through the network panel of Chrome that as long as the file "Workers/TerrainEncoding-1B092C0A.js" has no request, it will lead to countless data requests for the terrain. Do you have any suggestions to check it? My project is done by specifying CESIUM_BASE_URL of cesium on window – Dreams Jun 08 '21 at 11:09
  • I think this is another question. can you please make another question more clear? – ZhefengJin Jun 08 '21 at 11:33
  • @ZhefengJin could you expand the answer a little to help future people please, Dreams if this answers your question could you accept it. – Caribou Jun 08 '21 at 17:48
  • thanks for your answer, this answer is appropriate! – Dreams Jun 09 '21 at 01:46