Search code examples
cesiumjs

CesiumJS: How can I have a billboard always be on top?


I have a sandcastle

Playing with the eyeOffset fixes some of the issues with other entities being drawn on top of a billboard. However, when rotating the globe, it is still possible for an entity to appear on top of or in front of the billboard. For example,

line in front

I want the billboard to always appear in front or on top of all other entities unless the position it is at is no longer visible.

Is that possible? If so, how?


Solution

  • Short answer: Kind of...

    According to this thread on Cesium's forum this is something the team is aware of but it's unsure if they are going to ever implement a true Z-index for billboards since they're ordered based upon their 3D position.

    That being said, I looked at your sandcastle and it seems like you're already trying to use the eyeOffset which some users in that thread had mentioned it's not a great solution, but you may be able to tweak it to your needs.

    Hope this helps