瀏覽代碼

improve the track reset time line

tags/2.2.5
Caven Chen 4 年之前
父節點
當前提交
c3547efe11
共有 1 個文件被更改,包括 9 次插入3 次删除
  1. 9
    3
      modules/history-track/Track.js

+ 9
- 3
modules/history-track/Track.js 查看文件

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
} }



Loading…
取消
儲存