Swapping entity layers, can this be done?

I have a project where I’m loading dynamically created KML datasource. I can get to an entity in the KML using the following code but I’m wondering if there is a simple way to assign the layer stack to the entities?
plane = outagesLayer.entities.getById(‘plane’);

For instance, that plane object actually winds up below two other objects in my project. The plane follows a route across the country and that works fine. I want the plane to appear above the route of flight line and waypoints. Currently the plane icon is displayed below them. Looks funky.

Thanks for the tips!


Hi Gerry,

Unfortunately,we don’t have great support for this kind of ordering. It’s a frequently reported issue though, and is definitely on our radar.

In the meantime, you can try setting the eyeOffset property on the plane to something like this:

plane.eyeOffset = new Cesium.Cartesian3(0, 0, -100)



Thanks Hannah,

I did try setting eyeOffset and pixelOffset for plane.billboard. I had x & y movement when playing with settings in the console of the browser but the z axis wasn’t changing the plane’s view with regard to layers.

plane.billboard.pixelOffset = new Cesium.Cartesian3(0, 0, -100)

When I load this same KML in Google Earth it looks fine. It’s as if Cesium handles this information opposite of Google Earth and flips everything over in the layer stack.


Ok nevermind.

After testing…
plane.billboard.eyeOffset = new Cesium.Cartesian3(0, 0, -800)

I was able to get the plane above most of the waypoints and route lines that were drawn.