Check if terrain is loaded

Hello everybody

I'm working on a transfer from a GE solution to Cesium.
The project displays a 3D model of a helicopter and its trajectory synced with the cesium clock.
The user load the flight data and the viewer is opened. This work perfectly.
The only issue is that the UI from Cesium allows the user to click on play even if the terrain is not fully loaded.
I would like to find a way to prevent this and ensure the user will have the best experience possible.

Thanks in advance

Hi Olivier,

You can disable the ability to play the timeline with viewer.clockViewModel.canAnimate, then re-enable then when the terrain provider is ready like this:

viewer.clockViewModel.canAnimate = false;

viewer.terrainProvider.readyPromise.then(function () {

viewer.clockViewModel.canAnimate = true;

});

Thanks!

Gabby

Olivier,

This sounds like a cool project. Have you considered submitting it to be showcased on the Cesium demos page?

Sarah

Hello Sarah

Right now I have severe performance issues with my project, it take a very long time to load the terrain when the computer is not the best.

Maybe you have other feedback on this point that could help me ?

Once cleared it would be great to be showcased.

Best regards

Hi Oliver,

That sounds like it’s just a consequence of loading a lot of terrain data. If you can point us to a specific part of the code where you think there may be a performance bottleneck, perhaps we can help.

Thanks,

Gabby