Преглед изворни кода

improve the dynamic overlay

tags/2.2.5
Caven Chen пре 4 година
родитељ
комит
993a02ce5c

+ 3
- 3
modules/overlay/dynamic/DynamicBillboard.js Прегледај датотеку

/** /**
* 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

+ 4
- 4
modules/overlay/dynamic/DynamicModel.js Прегледај датотеку

/** /**
* 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)
/** /**

+ 4
- 6
modules/overlay/dynamic/DynamicOverlay.js Прегледај датотеку

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

Loading…
Откажи
Сачувај