How to snap to a position in CZML when paused?

Hey again,

My CZML data consists of a series of cartographicDegree positions and a single point which travels along those positions.

Is there a way to snap the point object to the closest position when I pause the playback of CZML data?

Is there a way to know what positions are nearby to my Point object?

Is there a way to know what positions are currently being show on the screen? For example, if I zoom really close to the positions, I only want to care about the positions I can actually see at that time.


For your second question, check out DynamicObjectView, which has been around for a while but is not in the current documentation (because of a doc bug which I’ll fix now that I found it). If you are using the Viewer widget, you can also assign the viewer.trackedObject property.

For your first question, there’s no way to directly snap to the closed point but this should be simple to do. Assuming you are using sampled positions, when the clock is paused, find the sample closest to the current time and then assign the clock.currentTime to the time of the sample.

Sounds good, thanks!