Skip to content

Commit

Permalink
Merge pull request #12284 from CesiumGS/fix-viewer-timeline
Browse files Browse the repository at this point in the history
Update Viewer timeline when data sources change
  • Loading branch information
lukemckinstry authored Nov 1, 2024
2 parents f21a07f + 2b74824 commit 377da51
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
name: "CZML Model",
version: "1.0",
clock: {
interval: "2015-01-01T00:00:00Z/2015-01-01T00:00:20Z",
currentTime: "2015-01-01T00:00:00Z",
interval: "2015-01-01T12:00:00Z/2015-01-01T12:00:20Z",
currentTime: "2015-01-01T12:00:00Z",
multiplier: 20,
},
},
Expand All @@ -55,7 +55,7 @@
nodeTransformations: {
Skeleton_arm_joint_L__3_: {
rotation: {
epoch: "2015-01-01T00:00:00Z",
epoch: "2015-01-01T12:00:00Z",
unitQuaternion: [
0, -0.23381920887303329, -0.6909886782144156, -0.0938384854833712,
0.6775378681547408, 10, -0.4924076887347565, -0.6304934596091216,
Expand Down
8 changes: 8 additions & 0 deletions packages/widgets/Source/Viewer/Viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1926,6 +1926,14 @@ Viewer.prototype._onDataSourceAdded = function (
dataSourceCollection,
dataSource,
) {
if (
this._cesiumWidget._automaticallyTrackDataSourceClocks &&
dataSource === this.clockTrackedDataSource
) {
// When data sources are added to the CesiumWidget they may be automatically
// tracked in that class but we also need to update the timeline in this class
linkTimelineToDataSourceClock(this._timeline, dataSource);
}
const id = dataSource.entities.id;
const removalFunc = this._eventHelper.add(
dataSource.changedEvent,
Expand Down

0 comments on commit 377da51

Please sign in to comment.