| | |
| | | |
| | | let eventLast = 0 |
| | | let addPlotOverlayData = null |
| | | let addPoliceIconOverlayData = null |
| | | let lableOverlayData = null |
| | | |
| | | export default { |
| | |
| | | if (isAddLabel) return |
| | | |
| | | if (poltType == 'billboard' && policeType == 'policeman') { |
| | | overlay.icon = '/img/icon/police-people.png' |
| | | overlay.icon = '/img/icon/man3.png' |
| | | } else if (poltType == 'billboard' && policeType == 'policecar') { |
| | | overlay.icon = '/img/policeCar.jfif' |
| | | overlay.icon = '/img/car3.png' |
| | | } |
| | | |
| | | |
| | | if (overlay) { |
| | | drawLayers.addOverlay(overlay) |
| | | |
| | | plot.edit(overlay, (e) => { |
| | | // drawLayers.addOverlay(overlay) |
| | | drawLayers.addOverlay(overlay) |
| | | |
| | | flag = true |
| | | |
| | |
| | | overlay.policeType = policeType |
| | | |
| | | that.$emit('setOverlayObj', overlay) |
| | | addPoliceIconOverlayData = overlay |
| | | |
| | | document.oncontextmenu = function () { |
| | | if (flag == true && poltType == 'billboard') { |
| | |
| | | that.$parent.policeChooseVisible = true |
| | | } else if (policeType == 'policecar') { |
| | | that.$emit('setPoliceOption') |
| | | |
| | | that.$parent.chooseCarColor = '#FF0000' |
| | | that.$parent.policeChooseCarVisible = true |
| | | } |
| | |
| | | plot.edit(overlayData, (e) => { |
| | | let position = '' |
| | | if('_positions' in overlayData){ |
| | | overlayData._positions.forEach(item => { |
| | | position += item._lng + ' ' + item._lat + ',' |
| | | }) |
| | | position = position.slice(0, position.length - 1) |
| | | overlayData._positions.forEach((item,index) => { |
| | | position += item._lng + ' ' + item._lat + ',' |
| | | }) |
| | | position = position.slice(0, position.length - 1) |
| | | }else{ |
| | | overlayData.position = { |
| | | lng: Number(overlayData._position._lng), |
| | |
| | | lng: Number(position[0]), |
| | | lat: Number(position[1]), |
| | | alt: 0.5, |
| | | } |
| | | } |
| | | let point = new global.DC.Point(pointPosition) |
| | | drawArrowLayers.addOverlay(point) |
| | | point.attrParams = { 'id': item.id, 'color': item.color, item } |
| | |
| | | } |
| | | }, |
| | | |
| | | addNewPolice(data,type){ |
| | | let positionObj = this.$parent.convertBillboardPositionDate(data, type) |
| | | let positionArr = data.position.slice(12, data.position.length - 2).split(',')[0].split(' ') |
| | | let position = new global.DC.Position(Number(positionArr[0]), Number(positionArr[1])) |
| | | let point = new global.DC.Point(position) |
| | | let color = '' |
| | | if (data.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150) |
| | | } else { |
| | | let r = parseInt(data.color.slice(1, 3), 16) |
| | | let g = parseInt(data.color.slice(3, 5), 16) |
| | | let b = parseInt(data.color.slice(5, 7), 16) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255) |
| | | } |
| | | console.log(positionObj,position,point,999); |
| | | point.attrParams = positionObj |
| | | drawLayers.addOverlay(point) |
| | | point.setStyle({ |
| | | "color": global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150), //颜色 |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 82, |
| | | }) |
| | | point.on(global.DC.MouseEventType.CLICK, this.$parent.overlayTypeClick) |
| | | point.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver) |
| | | point.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut) |
| | | addPoliceIconOverlayData.attrParams = positionObj |
| | | addPoliceIconOverlayData.position = { |
| | | lng: Number(positionArr[0]), |
| | | lat: Number(positionArr[1]), |
| | | alt: 0.5, |
| | | } |
| | | addPoliceIconOverlayData.on(global.DC.MouseEventType.CLICK, this.$parent.overlayTypeClick) |
| | | addPoliceIconOverlayData.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver) |
| | | addPoliceIconOverlayData.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut) |
| | | }, |
| | | |
| | | // 修改标绘样式 |
| | | editPlotStyle(params,overlay) { |
| | | if('color' in params){ |