Time varying polyline in CZML


I'm trying to create something similar to the D3+Cesium demo (https://github.com/abwood/d3cesium) for a project I'm working on.

I'd like to draw some vertical bars, with their length varying depending on the time.

- How can I define variable length "lines" like the ones in the D3+Cesium demo in a CZML file? Can somebody give me an example?
- How can I adjust the time interval of the "timeline" (the bottom control in the viewer) just to display a few years (in order to control the animation defined in the CZML file?).


Hi Alessio,

For time dynamic lines, you could use a polyline collection similar to what we did in the d3cesium demo or use the Geometry and Appearances to draw lots of polylines and define a custom appearance that will dynamically define the height of the polylines. Defining extruded Polygons may also be an option if a volume is an acceptable representation of your data (e.g., thick 3d vertical bars, country outlines, or whatever).

For modifying the time interval, you will need to configure both the ClockViewModel (how fast should the clock tick) and the AnimationViewModel (how does the user control the animation time step). For an example of how this is done, refer to the d3cesium example in github.

  • Alex

To do both of these things using CZML is pretty straight forward. For dynamic polylines, you need to use the “references” property when specifying the points in your vertexPositions. If you search for vertexPositions in the simple.czml included with Cesium, you’ll find something like







Both of those strings reference the id and position property of another objects. Those positions will be used when drawing a line. You can read more here: https://github.com/AnalyticalGraphicsInc/cesium/wiki/CZML-Content#vertexpositions

For the clock, you can defined a clock object at the top of your CZML file, see https://github.com/AnalyticalGraphicsInc/cesium/wiki/CZML-Content#clock for details (or you can also check out the top of the simple.cmzl file). By default, when a CZML document with clock settings is loaded, the Timeline is adjusted to those settings.