瀏覽代碼

improve the dynamic overlay

tags/2.2.5
Caven Chen 4 年之前
父節點
當前提交
993a02ce5c

+ 3
- 3
modules/overlay/dynamic/DynamicBillboard.js 查看文件

@@ -49,14 +49,14 @@ class DynamicBillboard extends DynamicOverlay {
/**
* set the location
*/
this._samplePosition.forwardExtrapolationType =
this._sampledPosition.forwardExtrapolationType =
Cesium.ExtrapolationType.HOLD
this._startTime = Cesium.JulianDate.now()
this._samplePosition.addSample(
this._sampledPosition.addSample(
this._startTime,
Transform.transformWGS84ToCartesian(this._posistion)
)
this._delegate.position = this._samplePosition
this._delegate.position = this._sampledPosition
this._cache.push(this._startTime)
/**
* initialize the Overlay parameter

+ 4
- 4
modules/overlay/dynamic/DynamicModel.js 查看文件

@@ -35,16 +35,16 @@ class DynamicModel extends DynamicOverlay {
/**
* set the location
*/
this._samplePosition.forwardExtrapolationType =
this._sampledPosition.forwardExtrapolationType =
Cesium.ExtrapolationType.HOLD
this._startTime = Cesium.JulianDate.now()
this._samplePosition.addSample(
this._sampledPosition.addSample(
this._startTime,
Transform.transformWGS84ToCartesian(this._posistion)
)
this._delegate.position = this._samplePosition
this._delegate.position = this._sampledPosition
this._delegate.orientation = new Cesium.VelocityOrientationProperty(
this._samplePosition
this._sampledPosition
)
this._cache.push(this._startTime)
/**

+ 4
- 6
modules/overlay/dynamic/DynamicOverlay.js 查看文件

@@ -14,7 +14,7 @@ class DynamicOverlay extends Overlay {
super()
this._startTime = undefined
this._lastTime = undefined
this._samplePosition = new Cesium.SampledPositionProperty()
this._sampledPosition = new Cesium.SampledPositionProperty()
this._cache = []
this._maxCacheSize = 10
this._state = State.INITIALIZED
@@ -31,7 +31,7 @@ class DynamicOverlay extends Overlay {

get position() {
return Transform.transformCartesianToWGS84(
this._samplePosition.getValue(Cesium.JulianDate.now())
this._sampledPosition.getValue(Cesium.JulianDate.now())
)
}

@@ -51,7 +51,7 @@ class DynamicOverlay extends Overlay {
-0.2,
new Cesium.JulianDate()
)
this._samplePosition.removeSamples(
this._sampledPosition.removeSamples(
new Cesium.TimeInterval({
start: start,
stop: stop
@@ -75,7 +75,7 @@ class DynamicOverlay extends Overlay {
interval,
new Cesium.JulianDate()
)
this._samplePosition.addSample(
this._sampledPosition.addSample(
time,
Transform.transformWGS84ToCartesian(Parse.parsePosition(position))
)
@@ -94,6 +94,4 @@ class DynamicOverlay extends Overlay {
}
}

Overlay.registerType('dynamic-model')

export default DynamicOverlay

Loading…
取消
儲存