| | |
| | | |
| | | this.$EventBus.$on('layerPointAdd', (params) => { |
| | | // eslint-disable-next-line no-unused-vars |
| | | // console.log(params.incident) |
| | | that.layerPointAdd(params.layerName, params.type, params.layerType, params.params, params.distanceDisplayCondition, params.incident) |
| | | }) |
| | | |
| | |
| | | // 最新写法 |
| | | const isFullScreen = document.fullscreenElement |
| | | if (isFullScreen) { |
| | | console.log('退出全屏') |
| | | if (document.exitFullscreen) { |
| | | document.exitFullscreen() |
| | | } else if (document.msExitFullscreen) { |
| | |
| | | this.isFullscreen = false |
| | | } else { |
| | | var fullscreen = document.body // 需要全屏的元素 |
| | | console.log('进入全屏') |
| | | if (fullscreen.requestFullscreen) { |
| | | fullscreen.requestFullscreen() |
| | | } else if (fullscreen.mozRequestFullScreen) { |
| | |
| | | layersObjcect[layerName] = new global.DC.ClusterLayer(layerName) |
| | | |
| | | layersObjcect[layerName].addTo(global.viewer) |
| | | } else if (type == 'HeatLayer') { |
| | | if (!layersObjcect[layerName]) layersObjcect[layerName] = null |
| | | |
| | | layersObjcect[layerName] = new global.DC.HeatLayer(layerName) |
| | | |
| | | layersObjcect[layerName].addTo(global.viewer) |
| | | } |
| | | }, |
| | | |
| | |
| | | * @param {*} type 图层类型 |
| | | */ |
| | | mapRemoveLayer (layerName, type) { |
| | | if (type == 'VectorLayer' || type == 'ClusterLayer') { |
| | | if (type == 'VectorLayer' || type == 'ClusterLayer' || type == 'HeatLayer') { |
| | | if (layersObjcect[layerName] && layersObjcect[layerName] != null) { |
| | | layersObjcect[layerName].remove() |
| | | layersObjcect[layerName] = null |
| | |
| | | * @param {*} type 图层类型 |
| | | */ |
| | | mapClearLayer (layerName, type) { |
| | | if (type == 'VectorLayer' || type == 'ClusterLayer') { |
| | | if (type == 'VectorLayer' || type == 'ClusterLayer' || type == 'HeatLayer') { |
| | | if (layersObjcect[layerName] && layersObjcect[layerName] != null) |
| | | layersObjcect[layerName].clear() |
| | | } |
| | |
| | | |
| | | if (type == "billboard") { |
| | | pointElement = new global.DC.Billboard(new global.DC.Position(Number(params.lng), Number(params.lat), Number(params.alt)), params.url) |
| | | |
| | | pointElement.size = [32, 32] |
| | | pointElement.attrParams = params |
| | | layersObjcect[layerName].addOverlay(pointElement) |
| | | pointElement.on(global.DC.MouseEventType.CLICK, incident) |
| | | } else if (type == "label") { |
| | | pointElement = new global.DC.Label(new global.DC.Position(Number(params.lng), Number(params.lat), Number(params.alt)), params.text) |
| | | |
| | | pointElement.setStyle({ |
| | | fillColor: global.DC.Color.CRIMSON, |
| | | style: global.DC.Namespace.Cesium.LabelStyle.FILL_AND_OUTLINE, |
| | |
| | | pixelOffset: { x: 0, y: -24 }, |
| | | distanceDisplayCondition: distanceDisplayCondition |
| | | }) |
| | | |
| | | } |
| | | |
| | | pointElement.attrParams = params |
| | | |
| | | layersObjcect[layerName].addOverlay(pointElement) |
| | | pointElement.on(global.DC.MouseEventType.CLICK, incident) |
| | | } else if (type == 'HeatPoint') { |
| | | layersObjcect[layerName].setPositions(params.positions) |
| | | } |
| | | |
| | | |
| | | }, |
| | | |
| | | /** |