Sandcastle CZML demo without CZML?

I'm building an application that will display historical traffic on a map. I want to do almost exactly what the Vehicle part of the Sandcastle CZML demo does:

- Create a path comprising many timestamped points (ideally cartographicDegrees)
- Render that path on a map
- Set the timeline's bounds to the time bounds of that path (*)
- When the timeline is playing, move a dot along the path
   - Ideally, when the timeline is playing, show only the part of the path between times (t) and (t-delta)

...but I want to do it all in code instead of loading a CZML file and I'll be doing it for a bunch (tens to thousands) of objects at once. I know that I'll run into performance limits at some point; right now I'm trying to figure out how to do this at all.

I've spent the day reading through archives here and elsewhere and I'm confused by references to classes like AnimationController that don't currently exist. It looks like the apocryphal Part 2 of the Visualizing Spatial Data tutorial is exactly what I need.

Is there a minimal example of how to do any or all of these tasks? I suspect I need to use CallbackProperty for the position of the moving dot, or maybe a PathVisualizer, but I feel like I'm missing something important.

(Note: the post at!msg/cesium-dev/dsP9zdj1-EI/v-dpQ9GFDAAJ seems to be getting pretty close.)


(*) ...or the union of many paths' availability intervals, which is more likely to be the case


You are on the right track. CZML (and KML and GeoJSON) are all backed by our Entity API, which is how you do what you want programmatically. You will most certainly want to use a SampledPositionProperty, which takes time-tagged data and interpolates it for you. If you have real-time, computed on-the-fly or really anything other than time-tagged dynamic data, then the callback makes more sense.

See this demo:

Excellent! Thank you very much! That got me close enough to get a prototype working.

That leads to the next question. I've simplified the geometry of the polylines that I want to display to reduce the rendering load. However, PathGraphics seems to insist on re-sampling the path via its 'resolution' parameter.

Is there a way to make PathGraphics use just the timestamped positions I give it? I suppose I could leave out the path and put in a polyline instead but that costs me the ability to do leadTime and trailTime.