This is certainly something that can be improved in CesiumJS. An obtuse, but correct way to check for this would be the value of viewer.clockViewModel.canAnimate
. If it’s true
, then all geometry is loaded. If it’s false
, then it can’t. You can wrap this in a postRender
resolve callback
await new Promise((resolve) => {
const removeEvent = viewer.scene.postRender.addEventListener(() => {
if (viewer.clockViewModel.canAnimate) {
removeEvent();
resolve();
}
});
});
I added it to one of the geometry Sandcastles to show an example
I also will add a link back to this post and a note to the GitHub issue that exists for addressing this: Scene ready event · Issue #4422 · CesiumGS/cesium · GitHub