Skip to content

Commit ab9ecd0

Browse files
committed
fix the stop issue
1 parent fd86036 commit ab9ecd0

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/modules/history-track/Track.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -325,17 +325,15 @@ class Track {
325325
this._positionIndex = 0
326326
} else if (params?.stopTime && params?.duration) {
327327
this._duration += params.duration
328-
this._timeLine = this._timeLine.map((item) => {
329-
if (Cesium.JulianDate.greaterThan(item, params.stopTime)) {
330-
item = Cesium.JulianDate.addSeconds(
331-
item,
332-
params.duration,
333-
new Cesium.JulianDate()
334-
)
335-
}
336-
return item
337-
})
328+
this._timeLine = this._timeLine.map((item) =>
329+
Cesium.JulianDate.addSeconds(
330+
item,
331+
params.duration,
332+
new Cesium.JulianDate()
333+
)
334+
)
338335
}
336+
339337
this._sampledPosition = new Cesium.SampledPositionProperty()
340338
this._sampledPosition.addSamples(
341339
this._timeLine,
@@ -360,9 +358,11 @@ class Track {
360358
interpolationAlgorithm: Cesium.LagrangePolynomialApproximation,
361359
})
362360
}
361+
363362
this._velocityOrientation = new Cesium.VelocityOrientationProperty(
364363
this._sampledPosition
365364
)
365+
366366
this._endTime = Cesium.JulianDate.addSeconds(
367367
this._timeLine[this._timeLine.length - 1],
368368
this._options.endDelayTime,

src/modules/history-track/TrackController.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ class TrackController {
147147

148148
/**
149149
*
150+
* @returns {TrackController}
150151
*/
151152
restore() {
152153
if (this._state !== State.PAUSE) {

0 commit comments

Comments
 (0)