|
|
|
@@ -6,7 +6,6 @@ |
|
|
|
import { |
|
|
|
LayerGroupEventType, |
|
|
|
LayerEventType, |
|
|
|
EffectEventType, |
|
|
|
MouseEvent, |
|
|
|
ViewerEvent, |
|
|
|
SceneEvent |
|
|
|
@@ -79,7 +78,6 @@ class Viewer { |
|
|
|
|
|
|
|
this._layerGroupCache = {} |
|
|
|
this._layerCache = {} |
|
|
|
this._effectCache = {} |
|
|
|
|
|
|
|
/** |
|
|
|
* Adds default components |
|
|
|
@@ -244,36 +242,6 @@ class Viewer { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param effect |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
_addEffect(effect) { |
|
|
|
if ( |
|
|
|
effect && |
|
|
|
effect.effectEvent && |
|
|
|
!Object(this._effectCache).hasOwnProperty(effect.id) |
|
|
|
) { |
|
|
|
effect.effectEvent.fire(EffectEventType.ADD, this) |
|
|
|
this._effectCache[effect.id] = effect |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param effect |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
_removeEffect(effect) { |
|
|
|
if ( |
|
|
|
effect && |
|
|
|
effect.effectEvent && |
|
|
|
Object(this._effectCache).hasOwnProperty(effect.id) |
|
|
|
) { |
|
|
|
effect.effectEvent.fire(EffectEventType.REMOVE, this) |
|
|
|
delete this._effectCache[effect.id] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Sets viewer options |
|
|
|
* @param options |
|
|
|
@@ -295,15 +263,6 @@ class Viewer { |
|
|
|
return this |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Restrict camera access underground |
|
|
|
* @returns {Viewer} |
|
|
|
*/ |
|
|
|
limitCameraToGround() { |
|
|
|
this._cameraOption.limitCameraToGround() |
|
|
|
return this |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param west |
|
|
|
* @param south |
|
|
|
@@ -426,6 +385,8 @@ class Viewer { |
|
|
|
* @returns {Viewer} |
|
|
|
*/ |
|
|
|
removeTerrain() { |
|
|
|
this._baseLayerPicker.terrainProviderViewModels = [] |
|
|
|
this._baseLayerPicker.selectedTerrain = undefined |
|
|
|
this._delegate.terrainProvider = new Cesium.EllipsoidTerrainProvider() |
|
|
|
return this |
|
|
|
} |
|
|
|
@@ -524,26 +485,6 @@ class Viewer { |
|
|
|
return this |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* adds an effect |
|
|
|
* @param effect |
|
|
|
* @returns {Viewer} |
|
|
|
*/ |
|
|
|
addEffect(effect) { |
|
|
|
this._addEffect(effect) |
|
|
|
return this |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* removes an effect |
|
|
|
* @param effect |
|
|
|
* @returns {Viewer} |
|
|
|
*/ |
|
|
|
removeEffect(effect) { |
|
|
|
this._removeEffect(effect) |
|
|
|
return this |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param target |
|
|
|
* @param duration |