Browse Source

1.完善场景初始化功能

tags/1.13.1
Caven Chen 4 years ago
parent
commit
65fca02b8d
3 changed files with 14 additions and 6 deletions
  1. 6
    0
      CHANGES.md
  2. 5
    5
      src/core/viewer/Viewer.js
  3. 3
    1
      src/core/widget/index.js

+ 6
- 0
CHANGES.md View File

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

+ 5
- 5
src/core/viewer/Viewer.js View File

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

@@ -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])
})
}


+ 3
- 1
src/core/widget/index.js View File

@@ -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(),
@@ -26,3 +26,5 @@ export default {
compass: new Compass(),
distanceLegend: new DistanceLegend()
}

export default Widgets

Loading…
Cancel
Save