瀏覽代碼

移除场景效果相关函数

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.13.0

## 2020-12-05

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

# 1.12.3 # 1.12.3


## 2020-11-28 ## 2020-11-28

+ 1
- 1
package.json 查看文件

{ {
"name": "@dvgis/dc-sdk", "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.", "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", "main": "index.js",
"repository": "https://github.com/dvgis/dc-sdk.git", "repository": "https://github.com/dvgis/dc-sdk.git",

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



const LayerEventType = BaseEventType const LayerEventType = BaseEventType


const EffectEventType = BaseEventType

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

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

import { import {
LayerGroupEventType, LayerGroupEventType,
LayerEventType, LayerEventType,
EffectEventType,
MouseEvent, MouseEvent,
ViewerEvent, ViewerEvent,
SceneEvent SceneEvent


this._layerGroupCache = {} this._layerGroupCache = {}
this._layerCache = {} this._layerCache = {}
this._effectCache = {}


/** /**
* Adds default components * Adds default components
} }
} }


/**
* @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 * Sets viewer options
* @param options * @param options
return this return this
} }


/**
* Restrict camera access underground
* @returns {Viewer}
*/
limitCameraToGround() {
this._cameraOption.limitCameraToGround()
return this
}

/** /**
* @param west * @param west
* @param south * @param south
* @returns {Viewer} * @returns {Viewer}
*/ */
removeTerrain() { removeTerrain() {
this._baseLayerPicker.terrainProviderViewModels = []
this._baseLayerPicker.selectedTerrain = undefined
this._delegate.terrainProvider = new Cesium.EllipsoidTerrainProvider() this._delegate.terrainProvider = new Cesium.EllipsoidTerrainProvider()
return this return this
} }
return this 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 target
* @param duration * @param duration

Loading…
取消
儲存