| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-13 10:13:53 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-02-29 18:08:14 | |||
| * @Last Modified time: 2020-03-09 21:26:57 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import Layer from './Layer' | |||
| @@ -18,6 +18,18 @@ DC.GeoJsonLayer = class extends Layer { | |||
| this.type = DC.LayerType.GEOJSON | |||
| } | |||
| set show(show) { | |||
| this._show = show | |||
| this._delegate && | |||
| this._delegate.then(dataSource => { | |||
| dataSource.show = this._show | |||
| }) | |||
| } | |||
| get show() { | |||
| return this._show | |||
| } | |||
| _createBillboard(entity) { | |||
| if (entity.position && entity.billboard) { | |||
| return DC.Billboard.fromEntity(entity) | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-09 09:16:27 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-02-29 18:09:12 | |||
| * @Last Modified time: 2020-03-09 21:11:15 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-02 16:42:03 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-02-29 18:09:45 | |||
| * @Last Modified time: 2020-03-09 21:11:05 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| @@ -22,7 +22,7 @@ DC.VectorLayer = class extends Layer { | |||
| clear() { | |||
| this._cache = {} | |||
| this._delegate.entities.removeAll() | |||
| this._delegate.entities && this._delegate.entities.removeAll() | |||
| this._state = DC.LayerState.CLEARED | |||
| return this | |||
| } | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-03 09:38:21 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-03-06 17:11:02 | |||
| * @Last Modified time: 2020-03-09 21:13:02 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import { LayerEvent } from '@/core/event' | |||
| @@ -99,7 +99,7 @@ class Layer { | |||
| this._delegate.removeAll() | |||
| this._viewer.delegate.scene.primitives.remove(this._delegate) | |||
| } else { | |||
| this._delegate.entities.removeAll() | |||
| this._delegate.entities && this._delegate.entities.removeAll() | |||
| this._viewer.delegate.dataSources.remove(this._delegate) | |||
| } | |||
| this._state = DC.LayerState.REMOVED | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2019-12-27 17:13:24 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-03-06 00:10:44 | |||
| * @Last Modified time: 2020-03-07 22:25:38 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| @@ -123,6 +123,10 @@ DC.Viewer = class { | |||
| return this._comps.mapSplit | |||
| } | |||
| get mapSwitch() { | |||
| return this._comps.mapSwitch | |||
| } | |||
| get locationBar() { | |||
| return this._comps.locationBar | |||
| } | |||
| @@ -2,9 +2,9 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-03-04 18:02:32 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-03-05 23:25:02 | |||
| * @Last Modified time: 2020-03-09 20:59:35 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import Widget from './Widget' | |||
| class LocationBar extends Widget { | |||
| @@ -23,13 +23,11 @@ class LocationBar extends Widget { | |||
| _moveHandler(movement) { | |||
| if (this._enable) { | |||
| console.log(movement) | |||
| } | |||
| } | |||
| _cameraHandler(e) { | |||
| if (this._enable) { | |||
| console.log(movement) | |||
| } | |||
| } | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-02-11 18:34:46 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-03-05 23:41:38 | |||
| * @Last Modified time: 2020-03-07 21:15:41 | |||
| */ | |||
| import Widget from './Widget' | |||
| @@ -63,10 +63,12 @@ class MapSwitch extends Widget { | |||
| } | |||
| addMap(map = {}) { | |||
| this._cache.push(map) | |||
| this._addItem(map) | |||
| if (this._cache.length > 1) { | |||
| this._wapper.style.visibility = 'visible' | |||
| if (this._enable) { | |||
| this._cache.push(map) | |||
| this._addItem(map) | |||
| if (this._cache.length > 1) { | |||
| this._wapper.style.visibility = 'visible' | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-19 13:38:48 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-02-29 18:11:57 | |||
| * @Last Modified time: 2020-03-09 21:28:16 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| @@ -19,6 +19,18 @@ DC.CzmlLayer = class extends Layer { | |||
| this.type = DC.LayerType.CZML | |||
| } | |||
| set show(show) { | |||
| this._show = show | |||
| this._delegate && | |||
| this._delegate.then(dataSource => { | |||
| dataSource.show = this._show | |||
| }) | |||
| } | |||
| get show() { | |||
| return this._show | |||
| } | |||
| eachOverlay(method, context) { | |||
| if (this._delegate) { | |||
| this._delegate.then(dataSource => { | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-02-27 00:35:35 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-02-29 18:12:36 | |||
| * @Last Modified time: 2020-03-09 21:28:43 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| import Layer from '@/core/layer/Layer' | |||
| @@ -55,14 +55,6 @@ DC.HeatmapLayer = class extends Layer { | |||
| this.type = DC.LayerType.HEAT | |||
| } | |||
| set show(show) { | |||
| this._show = show | |||
| } | |||
| get show() { | |||
| return this._show | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} position | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-19 11:03:17 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-02-29 18:13:10 | |||
| * @Last Modified time: 2020-03-09 21:28:59 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| @@ -19,6 +19,18 @@ DC.KmlLayer = class extends Layer { | |||
| this.type = DC.LayerType.KML | |||
| } | |||
| set show(show) { | |||
| this._show = show | |||
| this._delegate && | |||
| this._delegate.then(dataSource => { | |||
| dataSource.show = this._show | |||
| }) | |||
| } | |||
| get show() { | |||
| return this._show | |||
| } | |||
| eachOverlay(method, context) { | |||
| if (this._delegate) { | |||
| this._delegate.then(dataSource => { | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-18 18:22:23 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-02-24 13:30:25 | |||
| * @Last Modified time: 2020-03-09 21:15:26 | |||
| */ | |||
| const path = require('path') | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-18 18:22:23 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-02-27 12:48:24 | |||
| * @Last Modified time: 2020-03-07 21:34:45 | |||
| */ | |||
| const path = require('path') | |||