Is ZIndex "ordering ground geometry" supported for ordering entities with different geometry?

1. A concise explanation of the problem you’re experiencing.

I tried a workaround for the polygons clamped-to-ground not displaying outlines.

I tried loading the outlines as a separate set of polylines.

The polylines render before the polygons, and are rendered underneath the polygons, even though all the polygons have ZIndex = 0 and all the polylines have ZIndex = 1.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

I’m not going to write a Sandcastle example to demo this, I think someone on the Cesium team already knows the answer to my question, but if you want to see an example of my attempt to load polylines outlines for polygon, take a look at

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

the polygons clamped-to-ground without outlines issue, “Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.”

4. The Cesium version you’re using, your operating system and browser.

December Cesium release 1.52, Chrome Version 71.0.3578.98 (Official Build) (64-bit) on a Windows7 desktop, but same mobile results, rendering in Chrome 71.0.3578.98 on Android 8.0.0, and Safari on iOS 12.

I vaguely recall Gabby or someone on the Cesium team recommending the workaround of loading polylines for polygon outlines months ago, but can’t find that thread in my Cesium-dev topic subscriptions or Google search results.

If, as I now suspect, ZIndex “ordering ground geometry” only applies to other entities with the same geometry, then I may need to try chaining the async processes to insure that the polylines load, in order, AFTER polygons load, to render ON TOP of the polygons.

Please advise.



I think as long as the entities are using the same type of primitive then z-ordering should work. Just to confirm that for myself, this Sandcastle, can order a polyline on top of a polygon or vice versa just fine, because they’re both clamped to ground. But if the polyline is no longer clamped the zIndex stops behaving the way you’d expect.

I think this is because of how polyline entities switch from using Primitive to GroundPrimitive when they’re clamped. Do your results confirm this as well?

Just an update here, it looks like zIndex isn’t expected to work for polylines clamped to ground. Hannah’s adding a warning to that effect so it’s more obvious: