What are your z-ordering use cases?

Hello All,

I’m starting work on adding z-index support for entities. This will allow you to specify the order in which overlapping things appear, so for example you could specify which of two overlapping polygons draw on top.

This is one of our more frequently requested features and I’m happy to finally add this to Cesium! Before I get started on this, I would love to hear some of your use cases. I want to make sure my implementation meets as many of your needs as I can.

Here is my initial thinking:

  • Add a property to specify the ordering of overlapping geometry entities that draw on the globe surface (polylines/polygons/corridors/ellipses/rectangles with no height)

  • Billboards/labels/points will always draw on top of ground geometry. Other than that fix, their behavior will remain unchanged.

  • The order for polygons/polylines/etc that are not on the globe surface will remain unchanged (ie for a top down view, a polygon with a greater height will draw on top of a polygon with a lower height)

Please let me know if there is anything that I’m overlooking. And if this feature will help you, I would love to hear your input!

Thanks!

-Hannah

Hi Hannah,

I realize this is an old post but I was wondering what the status was for z-order support. We are trying to draw routes with waypoints (billboards or ellipses) on top of a polyline. In 2D, the line sometimes shows on top of the waypoints and sometimes below. We need to show the waypoints on top of the line every time. We are on Cesium 1.61. Thanks!

Sandra,

Some entities now do have a zIndex property you can use to control this. Both polyline and ellipse do, while billboards can be controlled with the eye offsets a bit, and/or tweaking the depth test to make them show through. If this doesn’t help, feel free to open a new thread with a Sandcastle example of your setup and we can take a look!