5 files modified
1 files added
| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 17:00:30 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-05-11 09:36:50 |
| | | * @LastEditTime: 2023-05-16 20:44:11 |
| | | * @FilePath: \srs-police-affairs\src\components\map\index.vue |
| | | * @Description: 公用地图组件 |
| | | * |
| | |
| | | import yToolTip from './components/yToolTip.vue' |
| | | import createTools from '@/utils/tools/index' |
| | | import { mapGetters } from 'vuex' |
| | | import { getLineSpeed } from '@/utils/turfPolygon' |
| | | |
| | | import yxLayerJson from './yxlayer' |
| | | |
| | |
| | | } else { |
| | | that.layerPolygonAdd(params.layerName, params.positions, params.material, params.distanceDisplayCondition, 'polygon', params.params, params.incident, params.mouseOverIncident, params.mouseOutIncident, params.setStyle) |
| | | } |
| | | }) |
| | | |
| | | this.$EventBus.$on('layerPolygonArrowsAdd', (params) => { |
| | | that.layerPolygonArrowsAdd(params.layerName, params.positions, params.material, params.polygonName, params.params, params.incident, params.mouseOverIncident, params.mouseOutIncident, params.setStyle) |
| | | }) |
| | | |
| | | this.$EventBus.$on('layerPolylineAdd', (params) => { |
| | |
| | | }, |
| | | |
| | | /** |
| | | * 图层面添加 |
| | | * @param {*} layerName 图层名称 |
| | | * @param {*} positions 图层位置数据 |
| | | * @param {*} material 颜色 |
| | | * @param {*} distanceDisplayCondition 可见距离 |
| | | */ |
| | | layerPolygonArrowsAdd (layerName, positions, material, polygonName = '', params, incident = (e) => { }, mouseOverIncident = (e) => { }, |
| | | mouseOutIncident = (e) => { }, setStyle = {}) { |
| | | if (!layersObjcect[layerName] || layersObjcect[layerName] == null) { |
| | | this.mapAddLayer(layerName, 'VectorLayer') |
| | | |
| | | layersObjcect[layerName].allowDrillPicking = true |
| | | } |
| | | |
| | | if (polygonName == '') { |
| | | polygonName = layerName + params.id |
| | | } |
| | | |
| | | polygonObj[polygonName] = new global.DC.Polyline(positions) |
| | | |
| | | |
| | | let positionData = positions.split(';').map(item => { |
| | | return [Number(item.split(',')[0]), Number(item.split(',')[1])] |
| | | }).filter(item => { |
| | | return !item.some(it => it == 0) |
| | | }) |
| | | |
| | | polygonObj[polygonName].setStyle({ |
| | | width: (params.width / 2), |
| | | material: new global.DC.PolylineImageTrailMaterialProperty({ |
| | | color: new global.DC.Color(255, 255, 255), |
| | | speed: 20, |
| | | image: '/images/arrows.png', |
| | | repeat: { |
| | | x: (getLineSpeed(positionData) / 2), y: 1 |
| | | } |
| | | }), |
| | | clampToGround: false, |
| | | ...setStyle |
| | | }) |
| | | |
| | | polygonObj[polygonName].attrParams = params |
| | | layersObjcect[layerName].addOverlay(polygonObj[polygonName]) |
| | | }, |
| | | |
| | | /** |
| | | * 图层线添加 |
| | | * @param {*} layerName 图层名称 |
| | | * @param {*} positions 图层位置数据 |
| | |
| | | this.$EventBus.$off('mapClearLayer') |
| | | this.$EventBus.$off('layerPointAdd') |
| | | this.$EventBus.$off('layerPolygonAdd') |
| | | this.$EventBus.$off('layerPolygonArrowsAdd') |
| | | this.$EventBus.$off('layerPolylineAdd') |
| | | this.$EventBus.$off('layerWallAdd') |
| | | this.$EventBus.$off('rowLayerWallAdd') |
| | |
| | | |
| | | addPlotOverlayData.attrParams = data |
| | | |
| | | this.$EventBus.$emit('layerPolygonArrowsAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionNewArr, |
| | | material: color, |
| | | params: { ...data, item: data, data: data } |
| | | }) |
| | | |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionStr, |
| | |
| | | overlay.attrParams.width = params.width |
| | | overlay.attrParams.remark = params.remark |
| | | |
| | | this.$EventBus.$emit('layerPolygonArrowsAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: linePosition, |
| | | material: color, |
| | | params: { ...overlay.attrParams, item: overlay.attrParams, data: overlay.attrParams }, |
| | | }) |
| | | |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionStr, |
| | |
| | | editLineInfo () { |
| | | const polyline = polylineOverlay |
| | | |
| | | this.$EventBus.$emit('mapRemovePolygonLayer', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | polygonName: 'newCarDrawLineLayers' + polyline.overlay.attrParams.id, |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapRemovePolygon', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | type: 'VectorLayer', |
| | |
| | | }) |
| | | polylineOverlay.overlay.remove() |
| | | polylineOverlay.overlay.attrParams.lineObj.remove() |
| | | |
| | | this.$EventBus.$emit('mapRemovePolygonLayer', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | polygonName: 'newCarDrawLineLayers' + polylineOverlay.overlay.attrParams.id, |
| | | type: 'VectorLayer' |
| | | }) |
| | | this.$EventBus.$emit('activeDeleteLineOrPoint', 'policecar') |
| | | } else { |
| | | this.$message({ |
| | |
| | | |
| | | lineLayer.addOverlay(lineObj) |
| | | |
| | | this.$EventBus.$emit('layerPolygonArrowsAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionNewArr, |
| | | material: color, |
| | | params: { ...item, lineObj, item, data: item } |
| | | }) |
| | | |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionStr, |
| | |
| | | mouseOverIncident: this.pointMouseOver, |
| | | mouseOutIncident: this.pointMouseOut |
| | | }) |
| | | |
| | | }) |
| | | }, |
| | | |
| | |
| | | <span>要素资源:</span> |
| | | <ul> |
| | | <li> |
| | | <button |
| | | @click="drawThreeArrow('billboard', 'police', 'policeman')" |
| | | title="警员" |
| | | > |
| | | <button @click="drawThreeArrow('billboard', 'police', 'policeman')" title="警员"> |
| | | <img src="/img/icon/police-people-btn.png" style="height:100%" /> |
| | | </button> |
| | | </li> |
| | | <li> |
| | | <button |
| | | @click="drawThreeArrow('billboard', 'police', 'policecar')" |
| | | title="警车" |
| | | > |
| | | <button @click="drawThreeArrow('billboard', 'police', 'policecar')" title="警车"> |
| | | <img src="/img/icon/car-btn.png" style="height:100%" /> |
| | | </button> |
| | | </li> |
| | | <li> |
| | | <button |
| | | @click="drawThreeArrow('billboard', 'icon', 'icon4')" |
| | | title="自定义图片标注" |
| | | >自定义图片标注</button> |
| | | <button @click="drawThreeArrow('billboard', 'icon', 'icon4')" title="自定义图片标注">自定义图片标注</button> |
| | | </li> |
| | | <li> |
| | | <button @click="drawThreeArrow('billboard', 'icon', 'icon5')" title="其他">其他</button> |
| | |
| | | <button @click="drawArrow('tailed_attack_arrow', 4)" title="燕尾箭头">燕尾箭头</button> |
| | | </li> |
| | | <li> |
| | | <button |
| | | @click="drawThreeArrow('polygon', 'polygon', 'polygon')" |
| | | title="多边形" |
| | | >多边形</button> |
| | | <button @click="drawThreeArrow('polygon', 'polygon', 'polygon')" title="多边形">多边形</button> |
| | | </li> |
| | | <li> |
| | | <button |
| | | @click="drawThreeArrow('brokenline', 'brokenline', 'brokenline')" |
| | | title="折线" |
| | | >折线</button> |
| | | <button @click="drawThreeArrow('brokenline', 'brokenline', 'brokenline')" title="折线">折线</button> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | |
| | | |
| | | addPlotOverlayData.attrParams = data |
| | | |
| | | this.$EventBus.$emit('layerPolygonArrowsAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionNewArr, |
| | | material: color, |
| | | params: { ...data, item: data, data: data }, |
| | | }) |
| | | |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionStr, |
| | |
| | | overlay.attrParams.width = params.width |
| | | overlay.attrParams.remark = params.remark |
| | | |
| | | this.$EventBus.$emit('layerPolygonArrowsAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: linePosition, |
| | | material: color, |
| | | params: { ...overlay.attrParams, item: overlay.attrParams, data: overlay.attrParams }, |
| | | }) |
| | | |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionStr, |
| | |
| | | .right { |
| | | height: 100%; |
| | | |
| | | & > div { |
| | | &>div { |
| | | display: flex; |
| | | } |
| | | |