Is there a way to update components of a CZML?

382 views
Skip to first unread message

Chris M.

unread,
Oct 9, 2014, 10:53:01 AM10/9/14
to cesiu...@googlegroups.com
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

Kevin Ring

unread,
Oct 9, 2014, 6:25:39 PM10/9/14
to cesiu...@googlegroups.com
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

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Chris M.

unread,
Oct 10, 2014, 8:44:56 AM10/10/14
to cesiu...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages