瀏覽代碼

improve HawkeyeMap

tags/3.0.1
Caven Chen 2 年之前
父節點
當前提交
95b79ea2ba
共有 1 個文件被更改,包括 4 次插入10 次删除
  1. 4
    10
      src/modules/widget/type/HawkeyeMap.js

+ 4
- 10
src/modules/widget/type/HawkeyeMap.js 查看文件

@@ -14,7 +14,6 @@ class HawkeyeMap extends Widget {
super()
this._wrapper = DomUtil.create('div', 'widget hawkeye-map', null)
this._wrapper.setAttribute('id', Util.uuid())
this._baseLayers = []
this._map = undefined
this._state = State.INITIALIZED
}
@@ -23,10 +22,6 @@ class HawkeyeMap extends Widget {
return Widget.getWidgetType('hawkeye_map')
}

get baseLayers() {
return this._baseLayers
}

/**
*
* @private
@@ -45,7 +40,6 @@ class HawkeyeMap extends Widget {
maximumZoomDistance: 40489014.0,
})
this._map = map

this._ready = true
}

@@ -111,14 +105,14 @@ class HawkeyeMap extends Widget {
return this
}
if (baseLayer) {
if (this._baseLayers && this._baseLayers.length) {
this._map.imageryLayers.removeAll()
}
this._map.imageryLayers.removeAll()
if (!Array.isArray(baseLayer)) {
baseLayer = [baseLayer]
}
baseLayer.forEach((item) => {
this._baseLayers.push(this._map.imageryLayers.addImageryProvider(item))
this._map.imageryLayers.add(
Cesium.ImageryLayer.fromProviderAsync(item, {})
)
})
}
return this

Loading…
取消
儲存