| /** | /** | ||||
| * set the location | * set the location | ||||
| */ | */ | ||||
| this._samplePosition.forwardExtrapolationType = | |||||
| this._sampledPosition.forwardExtrapolationType = | |||||
| Cesium.ExtrapolationType.HOLD | Cesium.ExtrapolationType.HOLD | ||||
| this._startTime = Cesium.JulianDate.now() | this._startTime = Cesium.JulianDate.now() | ||||
| this._samplePosition.addSample( | |||||
| this._sampledPosition.addSample( | |||||
| this._startTime, | this._startTime, | ||||
| Transform.transformWGS84ToCartesian(this._posistion) | Transform.transformWGS84ToCartesian(this._posistion) | ||||
| ) | ) | ||||
| this._delegate.position = this._samplePosition | |||||
| this._delegate.position = this._sampledPosition | |||||
| this._cache.push(this._startTime) | this._cache.push(this._startTime) | ||||
| /** | /** | ||||
| * initialize the Overlay parameter | * initialize the Overlay parameter |
| /** | /** | ||||
| * set the location | * set the location | ||||
| */ | */ | ||||
| this._samplePosition.forwardExtrapolationType = | |||||
| this._sampledPosition.forwardExtrapolationType = | |||||
| Cesium.ExtrapolationType.HOLD | Cesium.ExtrapolationType.HOLD | ||||
| this._startTime = Cesium.JulianDate.now() | this._startTime = Cesium.JulianDate.now() | ||||
| this._samplePosition.addSample( | |||||
| this._sampledPosition.addSample( | |||||
| this._startTime, | this._startTime, | ||||
| Transform.transformWGS84ToCartesian(this._posistion) | Transform.transformWGS84ToCartesian(this._posistion) | ||||
| ) | ) | ||||
| this._delegate.position = this._samplePosition | |||||
| this._delegate.position = this._sampledPosition | |||||
| this._delegate.orientation = new Cesium.VelocityOrientationProperty( | this._delegate.orientation = new Cesium.VelocityOrientationProperty( | ||||
| this._samplePosition | |||||
| this._sampledPosition | |||||
| ) | ) | ||||
| this._cache.push(this._startTime) | this._cache.push(this._startTime) | ||||
| /** | /** |
| super() | super() | ||||
| this._startTime = undefined | this._startTime = undefined | ||||
| this._lastTime = undefined | this._lastTime = undefined | ||||
| this._samplePosition = new Cesium.SampledPositionProperty() | |||||
| this._sampledPosition = new Cesium.SampledPositionProperty() | |||||
| this._cache = [] | this._cache = [] | ||||
| this._maxCacheSize = 10 | this._maxCacheSize = 10 | ||||
| this._state = State.INITIALIZED | this._state = State.INITIALIZED | ||||
| get position() { | get position() { | ||||
| return Transform.transformCartesianToWGS84( | return Transform.transformCartesianToWGS84( | ||||
| this._samplePosition.getValue(Cesium.JulianDate.now()) | |||||
| this._sampledPosition.getValue(Cesium.JulianDate.now()) | |||||
| ) | ) | ||||
| } | } | ||||
| -0.2, | -0.2, | ||||
| new Cesium.JulianDate() | new Cesium.JulianDate() | ||||
| ) | ) | ||||
| this._samplePosition.removeSamples( | |||||
| this._sampledPosition.removeSamples( | |||||
| new Cesium.TimeInterval({ | new Cesium.TimeInterval({ | ||||
| start: start, | start: start, | ||||
| stop: stop | stop: stop | ||||
| interval, | interval, | ||||
| new Cesium.JulianDate() | new Cesium.JulianDate() | ||||
| ) | ) | ||||
| this._samplePosition.addSample( | |||||
| this._sampledPosition.addSample( | |||||
| time, | time, | ||||
| Transform.transformWGS84ToCartesian(Parse.parsePosition(position)) | Transform.transformWGS84ToCartesian(Parse.parsePosition(position)) | ||||
| ) | ) | ||||
| } | } | ||||
| } | } | ||||
| Overlay.registerType('dynamic-model') | |||||
| export default DynamicOverlay | export default DynamicOverlay |