KML when loaded reverts to start of first gx:TimeSpan

Hi Cesium Team,

I realize KML support is still under development (and it looks great so far).

I’ve run into an issue regarding time in KML versus time stored in CZML and was hoping there would be a way around this…

When I load a KML file with gx:TimeSpans that are in the past, Cesium sets its clock’s currentTime to the first time span and then quickly tries to play through each TimeSpan (clock multiplier = 500,000x+). I assume Cesium is trying to span time so quickly because the time spans in the file at hand span six years.

My first inclination is to ask why Cesium would assume that loading a KML file would require the clock to start at the beginning. However, perhaps this is how it works in Google Earth?

Secondly, I’ve attempted to set the KmlDataSource clock = undefined as the documentation shows this is the default when the KML file does not have any time elements. However, this did not provide the behavior I was hoping for.

Should I load the KML file and then set the main scene’s clock to now? Or do you recommend a better approach?

Thank you.

  • Chris

You can pass the “automaticallyTrackDataSourceClocks” option as false when creating the Viewer object to disable this functionality. We had lots of requests from people to do this, which is why it’s on by default. This is true for all data sources, not just KML (though the KML handling can probable be improved). It’s a little funky right now because KML has no concept of “current time”. We’ll probably continue to tweak KML behavior so we appreciate the feedback.

You can programatically control things yourself by setting properties on both viewer.clock and viewer.timeline.