CZML Billboard is not showing

I have CZML with a point and a billboard loaded in a datasource. I am running the Viewer with requestRenderMode=true. When I toggle the datasource.show the point redraws as expected but the billboard will not render unless the globe is moved. I am using scene.requestRender() after the datasource.show is changed.

Here is my Sandcastle: Cesium Sandcastle

If I set requestRendermode=false then both the point and the billboard render as expected.

Thanks!
jan

Hey @barglowski, thanks for the question, sorry you’re running into issues.

When I run the sandcastle you provided both the point and the billboard show back up when I toggle the checkbox back on. I think your code looks ok too. Are you able to show what you’re seeing?

Hmmm…I’ve described the behavior pretty well. The billboard just does not render when turned on until the globe is moved/repositioned, which then causes a re-render. The point turns on/off by the checkbox just fine.

Hi @jjspace ,

I see the behavior you describe. Here’s what I see

  1. Billboard appears on initial Sandcastle open
  2. I click Datasource off
  3. The billboard and point disappear
  4. I click Datasource on
  5. The point reappears, but not the billboard
  6. When I move the Earth, the billboard does reappear

I have code turns the visibility of entire data sources on and off. That works without calling scene.requestRender(). (I did try commenting out the requestRender call in your sandcastle, and that made the map not change at all when the toggle was clicked.)

I also have a Sandcastle example of all polylines being programatically made not visible, and then made visible individually with time delays. I apologize that the code is scattered. I was vibe-ish coding and stopped when I got the result I wanted. It might have a direction to head on this though.

Neither of my examples use dashboards.

I wish I had more time to look into a more detailed explanation.

Best Regards,
Hamilton Carter

Hi @barglowski, we’ve been having the same issue, and I can see the same as you on the sandcastle you shared.

For some reason, adding a 0 second timeout before requesting the render works (See link below). Perhaps someone from Cesium can chip in and suggest why. Cheers.

1 Like

Hi @barglowski

An other solution would be to use the viewer.clock.

When using requestRenderMode: true, toggling a CZML DataSource with ds.show = true/false can cause billboards and labels not to reappear until you move the globe, while points update immediately.

This happens because points are simple primitives, but billboards/labels are batched into collections (BillboardCollection / LabelCollection) that only rebuild their draw commands during the DataSourceDisplay.update() cycle. In continuous render mode this happens every frame, but in request-render mode it doesn’t unless something else (like a camera move) triggers it.

To refresh everything, after toggling a datasource, explicitly call viewer.dataSourceDisplay.update(viewer.clock.currentTime) before scene.requestRender().
This forces Cesium to rebuild billboard/label batches immediately and ensures they show up correctly on every toggle.

Here is a sandcastle:
Example with viewer.clock

Regards,

Sebastien