Is there a way to update components of a CZML?

Hi all,

I’m wondering if anyone has found a way to update single components of a czml file on-demand. Right now I have a couple java classes that write a czml file using the CesiumLanguageWriter. These get streamed to the Cesium server, converted to a string, parsed, and finally added to the viewer.

The problem I’m facing is finding a way to update components of the object after its creation. For example by default I have a yellow path turned on and written on the initial creation of the czml, how could I make it so there is a way to call some function to change the path color to red after it has been loaded into the viewer? Is there a way to send through a small patch-like object that will override the original value of components. Or will I need to write my own custom data-source to allow for this level of control over an object?

Thanks,
Chris

Hi Chris,

CZML is designed to make this sort of thing really easy. If you give your CZML objects an “id” property, any later packets with that same ID will be considered an update to the previous object. You can send down the update packet from your server, if you want the server to drive the change, or you can create it on the client and pass it to CzmlDataSource.process.

Kevin

Hi Kevin,

That is exactly what I was looking for, thank you! That even solves another problem I was having with loading multiple objects, because I was forgetting to change the document ID for different objects which was confusing Cesium. Killed two birds with one stone, thanks again.

Chris