| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 17:00:30 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-04-12 17:19:40 |
| | | * @LastEditTime: 2023-04-15 17:15:38 |
| | | * @FilePath: \srs-police-affairs\src\components\map\index.vue |
| | | * @Description: 公用地图组件 |
| | | * |
| | |
| | | |
| | | <script> |
| | | let tile3DUrl = '' |
| | | let floorEntitysLayers = null |
| | | let flootEntitysEntites = null |
| | | |
| | | if (process.env.NODE_ENV == 'development') { |
| | | // 开发 |
| | |
| | | sdTilesetLayer: null |
| | | } |
| | | |
| | | let curPolygon = null |
| | | |
| | | const ysLabels = [ |
| | | 'EPSG:4490_test:0', |
| | |
| | | // let curTilesetLayer = new global.DC.TilesetLayer('curTilesetLayer') |
| | | // global.viewer.addLayer(curTilesetLayer) |
| | | // let curTileset = new global.DC.Tileset( |
| | | // // '/mx/tileset.json' |
| | | // 'https://tuan-gis.sit.fengtu.com.cn/361102/wanda/tileset.json' |
| | | // '/mx/tileset.json' |
| | | // ) |
| | | // // curTileset.setHeight(20) |
| | | // curTileset.setHeight(0) |
| | |
| | | global.viewer.addLayer(layersObjcect.monitoringLayer) |
| | | layersObjcect.panoramaLayer = new global.DC.VectorLayer('panoramaLayer') |
| | | global.viewer.addLayer(layersObjcect.panoramaLayer) |
| | | |
| | | floorEntitysLayers = new global.DC.VectorLayer('floorEntitysLayers') |
| | | global.viewer.addLayer(floorEntitysLayers) |
| | | |
| | | // 模型图层添加 |
| | | tilesetLayer = new global.DC.TilesetLayer('tilesetLayer') |
| | |
| | | |
| | | this.$EventBus.$on('layerPolygonAdd', (params) => { |
| | | if ('polygonName' in params) { |
| | | that.layerPolygonAdd(params.layerName, params.positions, params.material, params.distanceDisplayCondition, params.polygonName, params.params, params.incident, params.setStyle) |
| | | that.layerPolygonAdd(params.layerName, params.positions, params.material, params.distanceDisplayCondition, params.polygonName, params.params, params.incident, params.mouseOverIncident, params.mouseOutIncident, params.setStyle) |
| | | } else { |
| | | that.layerPolygonAdd(params.layerName, params.positions, params.material, params.distanceDisplayCondition, 'polygon', params.params, params.incident, params.setStyle) |
| | | that.layerPolygonAdd(params.layerName, params.positions, params.material, params.distanceDisplayCondition, 'polygon', params.params, params.incident, params.mouseOverIncident, params.mouseOutIncident, params.setStyle) |
| | | } |
| | | }) |
| | | |
| | |
| | | |
| | | if (this.tilesetLayerType == type && status == '') { |
| | | this.tilesetLayerType = '' |
| | | |
| | | |
| | | } else { |
| | | this.tilesetLayerType = type |
| | |
| | | * @param {*} material 颜色 |
| | | * @param {*} distanceDisplayCondition 可见距离 |
| | | */ |
| | | layerPolygonAdd (layerName, positions, material, distanceDisplayCondition, polygonName, params, incident = (e) => { }, setStyle = {}) { |
| | | layerPolygonAdd (layerName, positions, material, distanceDisplayCondition, polygonName, params, incident = (e) => { }, mouseOverIncident = (e) => { }, |
| | | mouseOutIncident = (e) => { }, setStyle = {}) { |
| | | if (!layersObjcect[layerName] || layersObjcect[layerName] == null) { |
| | | this.mapAddLayer(layerName, 'VectorLayer') |
| | | |
| | |
| | | // layersObjcect[layerName].addOverlay(polygon) |
| | | polygonObj[polygonName].attrParams = params |
| | | polygonObj[polygonName].on(global.DC.MouseEventType.CLICK, incident) |
| | | polygonObj[polygonName].on(global.DC.MouseEventType.MOUSE_OVER, mouseOverIncident) |
| | | polygonObj[polygonName].on(global.DC.MouseEventType.MOUSE_OUT, mouseOutIncident) |
| | | layersObjcect[layerName].addOverlay(polygonObj[polygonName]) |
| | | }, |
| | | |
| | |
| | | * @param {*} |
| | | */ |
| | | showThreeDimensions (positions, minHeight, maxHeight) { |
| | | if (floorEntitysLayers != null) { |
| | | floorEntitysLayers.remove() |
| | | floorEntitysLayers = new global.DC.VectorLayer('floorEntitysLayers') |
| | | global.viewer.addLayer(floorEntitysLayers) |
| | | if (curPolygon != null) { |
| | | global.viewer.scene.primitives.remove(curPolygon) |
| | | curPolygon = null |
| | | } |
| | | |
| | | floorEntitysLayers.clear() |
| | | |
| | | let housePositions = JSON.parse(positions).coordinates[0] |
| | | |
| | | let floorPositions = housePositions.reduce((prev, curr) => { |
| | | prev.push([curr[0], curr[1]]) |
| | | prev.push(curr[0]) |
| | | prev.push(curr[1]) |
| | | |
| | | return prev |
| | | }, []) |
| | | |
| | | let polygonStr = floorPositions.join(';') |
| | | curPolygon = new global.DC.Namespace.Cesium.ClassificationPrimitive({ |
| | | geometryInstances: new global.DC.Namespace.Cesium.GeometryInstance({ |
| | | geometry: new global.DC.Namespace.Cesium.PolygonGeometry({ |
| | | polygonHierarchy: new global.DC.Namespace.Cesium.PolygonHierarchy( |
| | | global.DC.Namespace.Cesium.Cartesian3.fromDegreesArray(floorPositions), |
| | | ), |
| | | extrudedHeight: maxHeight,//分层顶部海拔 |
| | | height: minHeight,//分层底部海拔 |
| | | }), |
| | | |
| | | let polygon = new global.DC.Polygon(polygonStr) |
| | | attributes: { |
| | | color: global.DC.Namespace.Cesium.ColorGeometryInstanceAttribute.fromColor(global.DC.Namespace.Cesium.Color.RED.withAlpha(0.5)), |
| | | show: new global.DC.Namespace.Cesium.ShowGeometryInstanceAttribute(true) |
| | | }, |
| | | }), |
| | | |
| | | polygon.setStyle({ |
| | | material: global.DC.Namespace.Cesium.Color.RED.withAlpha(0.5), |
| | | extrudedHeight: maxHeight, |
| | | height: minHeight, |
| | | extrudedHeightReference: global.DC.Namespace.Cesium.HeightReference.RELATIVE_TO_GROUND, |
| | | heightReference: global.DC.Namespace.Cesium.HeightReference.RELATIVE_TO_GROUND |
| | | classificationType: global.DC.Namespace.Cesium.ClassificationType.CESIUM_3D_TILE |
| | | }) |
| | | |
| | | floorEntitysLayers.addOverlay(polygon) |
| | | |
| | | floorEntitysLayers.show = true |
| | | global.viewer.scene.primitives.add(curPolygon) |
| | | }, |
| | | |
| | | // 清除建筑3D |
| | | clearHouse3D () { |
| | | floorEntitysLayers.clear() |
| | | global.viewer.scene.primitives.remove(curPolygon) |
| | | |
| | | curPolygon = null |
| | | }, |
| | | |
| | | registerMxClick (event) { |
| | |
| | | position: relative; |
| | | |
| | | &>div { |
| | | padding-bottom: 56px; |
| | | padding-bottom: 40px; |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | |
| | | position: relative; |
| | | |
| | | &>div { |
| | | padding-bottom: 56px; |
| | | padding-bottom: 40px; |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | |
| | | position: relative; |
| | | |
| | | &>div { |
| | | padding-bottom: 56px; |
| | | padding-bottom: 40px; |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | |
| | | image: isCenter ? this._options.icon_center : this._options.icon_anchor, |
| | | width: this._options.icon_size[0], |
| | | height: this._options.icon_size[1], |
| | | eyeOffset: new global.DC.Namespace.Cesium.Cartesian3(0, 0, -4), |
| | | eyeOffset: new global.DC.Namespace.Cesium.Cartesian3(0, 0, 0), |
| | | heightReference: |
| | | this._viewer.scene.mode === global.DC.Namespace.Cesium.SceneMode.SCENE3D && |
| | | !this._options.clampToModel |
| | |
| | | image: image, |
| | | width: 12, |
| | | height: 12, |
| | | eyeOffset: new global.DC.Namespace.Cesium.Cartesian3(0, 0, -4), |
| | | eyeOffset: new global.DC.Namespace.Cesium.Cartesian3(0, 0, -0), |
| | | heightReference: |
| | | this._viewer.scene.mode === global.DC.Namespace.Cesium.SceneMode.SCENE3D && |
| | | !this._options.clampToModel |
| | |
| | | addPlotOverlayData.attrParams = { id: item.id, color: item.color, item } |
| | | |
| | | addPlotOverlayData.on(global.DC.MouseEventType.CLICK, this.$parent.reeditArrowClick) |
| | | addPlotOverlayData.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver) |
| | | addPlotOverlayData.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut) |
| | | if (item.type == 6 || item.type == 7 || item.type == 8 || item.type == 11) { |
| | | const height = item.altitude.split(',') |
| | | let position = item.position.slice(12, item.position.length - 2).split(',')[0].split(' ') |
| | |
| | | alt: Number(height[0]), |
| | | } |
| | | |
| | | addPlotOverlayData.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver) |
| | | addPlotOverlayData.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut) |
| | | this.$parent.isHaveFactor = true |
| | | } else if (item.type == 5) { |
| | | addPlotOverlayData.setStyle({ |
| | |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionStr, |
| | | material: color, |
| | | params: data, |
| | | incident: this.$parent.lineOverlayTypeClick |
| | | params: { ...data, item: data, data: data }, |
| | | incident: this.$parent.lineOverlayTypeClick, |
| | | mouseOverIncident: this.$parent.pointMouseOver, |
| | | mouseOutIncident: this.$parent.pointMouseOut |
| | | }) |
| | | |
| | | this.$parent.isHaveLine = true |
| | |
| | | overlay.attrParams.polygonPositionStr = positionStr |
| | | overlay.attrParams.color = params.color |
| | | overlay.attrParams.width = params.width |
| | | overlay.attrParams.remark = params.remark |
| | | |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionStr, |
| | | material: color, |
| | | params: overlay.attrParams, |
| | | incident: this.$parent.lineOverlayTypeClick |
| | | params: { ...overlay.attrParams, item: overlay.attrParams, data: overlay.attrParams }, |
| | | incident: this.$parent.lineOverlayTypeClick, |
| | | mouseOverIncident: this.$parent.pointMouseOver, |
| | | mouseOutIncident: this.$parent.pointMouseOut |
| | | }) |
| | | |
| | | overlay.remove() |
| | |
| | | <img :src="curImgUrl" alt="" |
| | | style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto; z-index: 999; width: 20px; height: 20px;"> |
| | | </el-button> |
| | | |
| | | <images-select v-show="imagesListShow" @curClick="curClick"></images-select> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div v-show="customImageShow" style="font-size: 12px;"> |
| | | <span>建议图像尺寸:32x32、大小:10kb以内</span> |
| | | </div> |
| | | |
| | | <div class="btn-box"> |
| | | <el-button @click="savePolygonInfo">保存</el-button> |
| | | <el-button @click="cancelSavePolygon">取消</el-button> |
| | |
| | | curLinePosition = e.overlay.attrParams.linePositionStr |
| | | curLinePolygonPosition = e.overlay.attrParams.polygonPositionStr |
| | | |
| | | this.lineRemark = e.overlay.attrParams.remark |
| | | this.lineRemark = e.overlay.attrParams.item.remark |
| | | this.lineWidth = e.overlay.attrParams.width != -1 ? e.overlay.attrParams.width : 100 |
| | | this.chooseColor = e.overlay.attrParams.color != '' ? e.overlay.attrParams.color : '#1CA085' |
| | | this.policeIconId = e.overlay.attrParams.id |
| | |
| | | } |
| | | coverage.attrParams = { id: params.id, color: params.color, item: params } |
| | | coverage.on(global.DC.MouseEventType.CLICK, this.reeditArrowClick) |
| | | |
| | | coverage.on(global.DC.MouseEventType.MOUSE_OVER, this.pointMouseOver) |
| | | coverage.on(global.DC.MouseEventType.MOUSE_OUT, this.pointMouseOut) |
| | | arrowsListLayer.addOverlay(coverage) |
| | | |
| | | return coverage |
| | | }, |
| | | |
| | |
| | | |
| | | if ( |
| | | e.overlay.attrParams.item && e.overlay.attrParams.item.type && |
| | | (e.overlay.attrParams.item.type == 6 || |
| | | ( |
| | | e.overlay.attrParams.item.type == 1 || |
| | | e.overlay.attrParams.item.type == 2 || |
| | | e.overlay.attrParams.item.type == 3 || |
| | | e.overlay.attrParams.item.type == 4 || |
| | | e.overlay.attrParams.item.type == 5 || |
| | | e.overlay.attrParams.item.type == 6 || |
| | | e.overlay.attrParams.item.type == 7 || |
| | | e.overlay.attrParams.item.type == 8 || |
| | | e.overlay.attrParams.item.type == 10 || |
| | | e.overlay.attrParams.item.type == 11)) { |
| | | hoverData.billboard = true |
| | | } else { |
| | |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionStr, |
| | | material: color, |
| | | params: { ...item, lineObj }, |
| | | incident: this.lineOverlayTypeClick |
| | | params: { ...item, lineObj, item, data: item }, |
| | | incident: this.lineOverlayTypeClick, |
| | | mouseOverIncident: this.pointMouseOver, |
| | | mouseOutIncident: this.pointMouseOut |
| | | }) |
| | | |
| | | }) |
| | |
| | | addPlotOverlayData.attrParams = { id: item.id, color: item.color, item } |
| | | |
| | | addPlotOverlayData.on(global.DC.MouseEventType.CLICK, this.$parent.reeditArrowClick) |
| | | addPlotOverlayData.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver) |
| | | addPlotOverlayData.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut) |
| | | if (item.type == 6 || item.type == 7 || item.type == 8 || item.type == 11) { |
| | | const height = item.altitude.split(',') |
| | | let position = item.position.slice(12, item.position.length - 2).split(',')[0].split(' ') |
| | |
| | | lat: Number(position[1]), |
| | | alt: Number(height[0]), |
| | | } |
| | | |
| | | addPlotOverlayData.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver) |
| | | addPlotOverlayData.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut) |
| | | |
| | | this.$parent.isHaveFactor = true |
| | | } else { |
| | |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionStr, |
| | | material: color, |
| | | params: data, |
| | | incident: this.$parent.lineOverlayTypeClick |
| | | params: { ...data, item: data, data: data }, |
| | | incident: this.$parent.lineOverlayTypeClick, |
| | | mouseOverIncident: this.$parent.pointMouseOver, |
| | | mouseOutIncident: this.$parent.pointMouseOut |
| | | }) |
| | | |
| | | this.$parent.isHaveLine = true |
| | |
| | | overlay.attrParams.polygonPositionStr = positionStr |
| | | overlay.attrParams.color = params.color |
| | | overlay.attrParams.width = params.width |
| | | overlay.attrParams.remark = params.remark |
| | | |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionStr, |
| | | material: color, |
| | | params: overlay.attrParams, |
| | | incident: this.$parent.lineOverlayTypeClick |
| | | params: { ...overlay.attrParams, item: overlay.attrParams, data: overlay.attrParams }, |
| | | incident: this.$parent.lineOverlayTypeClick, |
| | | mouseOverIncident: this.$parent.pointMouseOver, |
| | | mouseOutIncident: this.$parent.pointMouseOut |
| | | }) |
| | | |
| | | overlay.remove() |