| this._trackEvent.on(TrackEventType.POST_RENDER, this._onPostRender, this) | this._trackEvent.on(TrackEventType.POST_RENDER, this._onPostRender, this) | ||||
| this._trackEvent.on(TrackEventType.ADD, this._onAdd, this) | this._trackEvent.on(TrackEventType.ADD, this._onAdd, this) | ||||
| this._trackEvent.on(TrackEventType.REMOVE, this._onRemove, this) | this._trackEvent.on(TrackEventType.REMOVE, this._onRemove, this) | ||||
| this._trackEvent.on( | |||||
| TrackEventType.RESET_TIME_LINE, | |||||
| this._resetTimeLine, | |||||
| this | |||||
| ) | |||||
| this._state = State.INITIALIZED | this._state = State.INITIALIZED | ||||
| } | } | ||||
| if (Cesium.JulianDate.greaterThan(item, params.stopTime)) { | if (Cesium.JulianDate.greaterThan(item, params.stopTime)) { | ||||
| item = Cesium.JulianDate.addSeconds( | item = Cesium.JulianDate.addSeconds( | ||||
| item, | item, | ||||
| params.stopTime, | |||||
| params.duration, | |||||
| new Cesium.JulianDate() | new Cesium.JulianDate() | ||||
| ) | ) | ||||
| } | } | ||||
| return item | return item | ||||
| }) | }) | ||||
| } else { | |||||
| this._pathPositions = [] | |||||
| } | } | ||||
| this._sampledPosition = new Cesium.SampledPositionProperty() | this._sampledPosition = new Cesium.SampledPositionProperty() | ||||
| this._sampledPosition.addSamples( | this._sampledPosition.addSamples( | ||||
| this._sampledPosition | this._sampledPosition | ||||
| ) | ) | ||||
| this._endTime = this._timeLine[this._timeLine.length - 1] | this._endTime = this._timeLine[this._timeLine.length - 1] | ||||
| this._pathPositions = [] | |||||
| } | } | ||||
| /** | /** | ||||
| addPosition(position, duration) { | addPosition(position, duration) { | ||||
| this._positions.push(Parse.parsePosition(position)) | this._positions.push(Parse.parsePosition(position)) | ||||
| this._duration += duration | this._duration += duration | ||||
| this._resetTimeLine() | |||||
| this._resetTimeLine({}) | |||||
| return this | return this | ||||
| } | } | ||||