Skip to content

Commit

Permalink
1.完善场景初始化功能
Browse files Browse the repository at this point in the history
  • Loading branch information
cavencj committed Dec 10, 2020
1 parent 3156bcf commit 65fca02
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Change Log
==========

### 1.13.1 - 2020-12-12

> 1. 添加比例尺组件
> 2. 完善场景组件的初始化功能
> 3. 开放部分场景属性
### 1.13.0 - 2020-12-05

> 1. 升级 Cesium 到 1.76
Expand Down
10 changes: 5 additions & 5 deletions src/core/viewer/Viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ViewerOption, CameraOption } from '../option'
import { DomUtil } from '../utils'
import Transform from '../transform/Transform'
import Parse from '../parse/Parse'
import Widget from '../widget'
import Widgets from '../widget'

const { Cesium } = DC.Namespace

Expand Down Expand Up @@ -64,16 +64,16 @@ class Viewer {

this._baseLayerPicker = new Cesium.BaseLayerPickerViewModel({
globe: this._delegate.scene.globe
})
}) //Initialize the baseLayer picker

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

/**
* Adds default widgets
* Registers default widgets
*/
Object.keys(Widget).forEach(key => {
this.use(Widget[key])
Object.keys(Widgets).forEach(key => {
this.use(Widgets[key])
})
}

Expand Down
4 changes: 3 additions & 1 deletion src/core/widget/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import HawkeyeMap from './HawkeyeMap'
import Compass from './Compass'
import DistanceLegend from './DistanceLegend'

export default {
const Widgets = {
attribution: new Attribution(),
popup: new Popup(),
contextMenu: new ContextMenu(),
Expand All @@ -26,3 +26,5 @@ export default {
compass: new Compass(),
distanceLegend: new DistanceLegend()
}

export default Widgets

0 comments on commit 65fca02

Please sign in to comment.