| super() | super() | ||||
| this._wrapper = DomUtil.create('div', 'widget hawkeye-map', null) | this._wrapper = DomUtil.create('div', 'widget hawkeye-map', null) | ||||
| this._wrapper.setAttribute('id', Util.uuid()) | this._wrapper.setAttribute('id', Util.uuid()) | ||||
| this._baseLayers = [] | |||||
| this._map = undefined | this._map = undefined | ||||
| this._state = State.INITIALIZED | this._state = State.INITIALIZED | ||||
| } | } | ||||
| return Widget.getWidgetType('hawkeye_map') | return Widget.getWidgetType('hawkeye_map') | ||||
| } | } | ||||
| get baseLayers() { | |||||
| return this._baseLayers | |||||
| } | |||||
| /** | /** | ||||
| * | * | ||||
| * @private | * @private | ||||
| maximumZoomDistance: 40489014.0, | maximumZoomDistance: 40489014.0, | ||||
| }) | }) | ||||
| this._map = map | this._map = map | ||||
| this._ready = true | this._ready = true | ||||
| } | } | ||||
| return this | return this | ||||
| } | } | ||||
| if (baseLayer) { | if (baseLayer) { | ||||
| if (this._baseLayers && this._baseLayers.length) { | |||||
| this._map.imageryLayers.removeAll() | |||||
| } | |||||
| this._map.imageryLayers.removeAll() | |||||
| if (!Array.isArray(baseLayer)) { | if (!Array.isArray(baseLayer)) { | ||||
| baseLayer = [baseLayer] | baseLayer = [baseLayer] | ||||
| } | } | ||||
| baseLayer.forEach((item) => { | baseLayer.forEach((item) => { | ||||
| this._baseLayers.push(this._map.imageryLayers.addImageryProvider(item)) | |||||
| this._map.imageryLayers.add( | |||||
| Cesium.ImageryLayer.fromProviderAsync(item, {}) | |||||
| ) | |||||
| }) | }) | ||||
| } | } | ||||
| return this | return this |