Loading Primitives Completion?

Hi all,

Is there an event or field (maybe in viewer.scene.primitives?) that I can poll to see when my primitives (billboards + continent/country polygons read from multiple topojson files) have all completely loaded and rendered on screen? Right now, as things are being loaded + rendered, when I move the mouse inside the div containing the globe, the screen flickers (black/white/black/white...). When the primitives are completely rendered, then the flickering stops on mouse move.

To remedy this, I would like to show a "loading" splash screen on top of the globe div while the primitives are being rendered, and once complete, then remove the splash screen.

Thanks for the help,
Naushervan

Naushervan,

In the low-level graphics code, Primitive has a ready flag (billboards currently do not). I’m not sure if this is what you are looking for though as it sounds like you want to know about the TopoJSON loading, which is part of the code I am not familiar with.

I would not expect the flickering though. Are your drivers up-to-date? Have you tried on different browsers? Are there other overlapping divs? What if you just drag and drop the TopoJSON files on Cesium Viewer? Does it flicker?

Patrick

Thanks, Patrick. The ready flag of the primitives was what I was looking for. Until ready is true (I use JavaScript's setInterval to poll the ready value), I show a loading splash screen. When ready is true, there is no more black/white flickering on moving the mouse, so problem resolved.

Side note: Maybe the flickering occurs during topojson loading/rendering because I have set the background to white (I am not using the default constellation background) with the scene's skybox and background properties. When I drag and drop my topojson into the Cesium Viewer that you linked in your reply, there is no flickering while the topojson is loaded. So maybe on mouse move, the background is constantly being refreshed (to repaint the new mouse position) from the constellation black that is default to the white that I have set.

Nevertheless, thanks a lot for the kind help!