CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
13.02k stars 3.51k forks source link

Update Viewer timeline when data sources change #12284

Closed jjspace closed 3 weeks ago

jjspace commented 3 weeks ago

Description

In https://github.com/CesiumGS/cesium/pull/12202 we moved most of the tracking logic into the CesiumWidget class. However this skipped the update for the timeline to zoom it to the correct time period when data sources are added, like in this sandcastle

There may be a cleaner solution here but I think this closely matches the previous behavior. Longer term I would've expected the timeline to reflect the values of the clock closer including the start/end times like the Animation widget does.

(We also noticed the model disappears but that's a separate issue https://github.com/CesiumGS/cesium/issues/12282)

Issue number and link

No issue

Testing plan

Author checklist

github-actions[bot] commented 3 weeks ago

Thank you for the pull request, @jjspace!

:white_check_mark: We can confirm we have a CLA on file for you.

jjspace commented 3 weeks ago

I opened https://github.com/CesiumGS/cesium/issues/12285 to discuss changing the Timeline itself which I think would've avoided this issue and may allow us to remove the linkTimelineToDataSourceClock function in its entirety but that doesn't need to hold up this PR right before the release

jjspace commented 3 weeks ago

CC @jfayot No action needed but thought you might be interested in this follow up. Something I missed while reviewing your PR. Odd little side effect of the weird way these classes interact with each other and the order event handlers are triggered. If you do think of a better solution than this please let us know.