RE: [cesium-dev] Re: object timeout czml [SEC=UNCLASSIFIED]


Thanks for the reply Rachel.

These options don’t wholly match my requirement.

Put more simply: after 30 seconds, I’d like the Cesium runtime to remove an entity from the active entitycollection, freeing memory. I’d rather not write my
own naïve “cull” code if the runtime can do it for me.

Since my use of Cesium is dynamic (I’m not that interested in the history), where-by I’m constructing CZML packets on arrival of network traffic server-side,
I’d have to keep a list of all the current entities and their current “active time” either server or client side. This way when I iterate through the entitycollection, I make a passing check to see how long each entity has been active, and if it’s been active
for my 30 second requirement, mark it for deletion with a CZML delete packet. If during these 30 seconds incoming data for a existing entity arrives, I’d “refresh” the timeout to having been active for 0 seconds.

I can do all of this, but you make the point that it’s expensive. I could probably devise an asynchronous solution with callbacks, but why the complexity?
It would be useful if I could simply give an entity a property like “timeout” in the CZML and the Cesium runtime actuate a delete when currentTime reaches timeout.

[] On Behalf Of Rachel Hwang

Hi James,

Unfortunately, we don’t yet have a native solution for your timeout problem. The approach would indeed be to have a process that just runs every x seconds and checks to see whether some property of your entities has been updated. To make this slightly cleaner, you could still use the availability property of Entity. When you add a new entity to your collection, you can set availability to a TimeIntervalCollection consisting of a single interval from current time to 30 seconds out. Then in your check process, just cull any entity that is no long available.

Hope that helps,

  • Rachel