浏览代码

移除场景效果相关函数

tags/1.13.0
Caven Chen 4 年前
父节点
当前提交
a52ee764f5
共有 4 个文件被更改,包括 11 次插入66 次删除
  1. 7
    0
      CHANGE.md
  2. 1
    1
      package.json
  3. 1
    4
      src/core/event/EventType.js
  4. 2
    61
      src/core/viewer/Viewer.js

+ 7
- 0
CHANGE.md 查看文件

@@ -1,5 +1,12 @@
# 更新

# 1.13.0

## 2020-12-05

> 1. 移除场景效果相关函数
> 2. 完善地形移除函数

# 1.12.3

## 2020-11-28

+ 1
- 1
package.json 查看文件

@@ -1,6 +1,6 @@
{
"name": "@dvgis/dc-sdk",
"version": "1.12.3",
"version": "1.13.0",
"description": " The SDK is a secondary development based on the open source project Cesium, which optimizes some operations of Cesium and enables developers to quickly develop 3D applications through the framework.",
"main": "index.js",
"repository": "https://github.com/dvgis/dc-sdk.git",

+ 1
- 4
src/core/event/EventType.js 查看文件

@@ -56,14 +56,11 @@ const LayerGroupEventType = BaseEventType

const LayerEventType = BaseEventType

const EffectEventType = BaseEventType

export {
MouseEventType,
ViewerEventType,
SceneEventType,
LayerGroupEventType,
LayerEventType,
OverlayEventType,
EffectEventType
OverlayEventType
}

+ 2
- 61
src/core/viewer/Viewer.js 查看文件

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

正在加载...
取消
保存