説明
What happened?
Not sure if this is intended behavior or not. And if so, a bug vs feature request.
When adding dataSources, the latest dataSource appears to be setting clockTrackedDataSource even if it's a geoJSON or kml source. Since the clock isn't being updated, I'd expect the clockTrackedDataSource value to also not change. It's possible it behaves this way for other file structures I'm not aware of that have clocks that may be set outside the area I was looking in.
https://github.com/CesiumGS/cesium/blob/1.113/packages/widgets/Source/Viewer/Viewer.js#L1561 sets the value
However, the function trackDataSourceClock checks if there's a clock. It seems like a clock check should happen (if possible) before setting the tracked data source.
Reproduction steps
We have a page where you can drag/drop files onto a map.
These files can be removed. However, if a user attempts to remove a dataSource we wanted to stop the animation IF the clockTrackedDataSource matched the dataSource we were trying to remove. This is difficult since the tracked data source doesn't match the currently running animation.
- Added GeoJSON file
- Added CZML file with a clock
- Added GeoJSON file
- The
clockTrackedDataSourceupdated each time a new file was added, I'd expect it to only change on the second one.
The sandcastle example just has a CZML that's loaded, then a GeoJSON loaded right after. It console.logs the clockTrackedDataSource value.
Sandcastle example
Environment
Browser: Edge/Chrome CesiumJS Version: 1.113/1.112 Operating System: Windows 10/Ubuntu 20