| | |
| | | global.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, this.viewerLableMove) |
| | | global.viewer.on(global.DC.MouseEventType.LEFT_UP, this.labelUp) |
| | | }) |
| | | |
| | | |
| | | }, |
| | | |
| | | methods: { |
| | |
| | | this.updateSecurityPlot({ id: overlayData.attrParams.id, position: position }) |
| | | }) |
| | | } else if (type == "line") { |
| | | plot.edit(overlayData, (e) => { |
| | | let lineOverlayData = overlayData.attrParams.lineObj |
| | | plot.edit(lineOverlayData, (e) => { |
| | | let position = '' |
| | | overlayData._positions.forEach(item => { |
| | | lineOverlayData._positions.forEach(item => { |
| | | position += item._lng + ' ' + item._lat + ',' |
| | | }) |
| | | position = position.slice(0, position.length - 1) |
| | | this.updateActivityCar({ id: this.policeIconId, color: this.chooseColor, width: this.lineWidth, type: 1, position: position }) |
| | | this.updateActivityCar({ id: this.policeIconId, color: this.$parent.chooseColor, width: this.lineWidth, type: 1, position: position },overlayData) |
| | | }) |
| | | } |
| | | }, |
| | |
| | | }) |
| | | addPlotOverlayData.on(global.DC.MouseEventType.CLICK, this.$parent.reeditArrowClick) |
| | | if(item.type == 6 || item.type == 7 || item.type == 8 ) { |
| | | console.log(addPlotOverlayData,666); |
| | | let position = item.position.slice(12, item.position.length - 2).split(',')[0].split(' ') |
| | | let pointPosition = new global.DC.Position(Number(position[0]), Number(position[1])) |
| | | addPlotOverlayData.position = { |
| | |
| | | addNewPolice(data,type,carType){ |
| | | // 巡逻路线添加 |
| | | if(type == 'policecar' && carType == 1) { |
| | | console.log(data,666665); |
| | | // 线坐标字符串 |
| | | let positionNewArr = this.$parent.convertPolylineOrPolygonPositionDate(data.position, data.type) |
| | | positionNewArr = positionNewArr.slice(1,positionNewArr.length - 2) |
| | | // 范围面坐标串 |
| | | let coords = global.DC.GeoTools.polylineBuffer(positionNewArr, data.width != -1 ? data.width : 100) |
| | | let positionStr = '' |
| | | coords.forEach(item => { |
| | | coords.forEach((item,index) => { |
| | | if(!(index == coords.length - 1)){ |
| | | positionStr += item[0] + ',' + item[1] + ';' |
| | | } |
| | | }) |
| | | positionStr = positionStr.slice(0,positionStr.length - 1) |
| | | // 面颜色 |
| | | let color = '' |
| | | // 线颜色 |
| | |
| | | 'width': 3 |
| | | }) |
| | | |
| | | |
| | | // let lineObj = new global.DC.Polyline(positionNewArr) |
| | | // drawLayers.addOverlay(lineObj) |
| | | // lineObj.setStyle({ |
| | | // 'material': lineColor, |
| | | // 'width': 3 |
| | | // }) |
| | | data.linePositionStr = positionNewArr |
| | | data.polygonPositionStr = positionStr |
| | | data.lineObj = addPoliceIconOverlayData |
| | | |
| | | // this.$EventBus.$emit('layerPolygonAdd', { |
| | | // layerName: 'newCarDrawLineLayers', |
| | | // positions: positionStr, |
| | | // material: color, |
| | | // params: data, |
| | | // incident: this.lineOverlayTypeClick |
| | | // }) |
| | | let areaPolygon = new global.DC.Polygon(positionStr) |
| | | console.log('positionStr',positionStr); |
| | | drawLayers.addOverlay(areaPolygon) |
| | | areaPolygon.setStyle({ |
| | | 'material': lineColor, |
| | | 'material': color, |
| | | 'height': 0.01, |
| | | }) |
| | | addPoliceIconOverlayData.attrParams = data |
| | | areaPolygon.attrParams = data |
| | | console.log('areaPolygon',areaPolygon); |
| | | |
| | | let lineObj = new global.DC.Polyline(positionNewArr) |
| | | drawLayers.addOverlay(lineObj) |
| | | lineObj.setStyle({ |
| | | 'material': global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150), |
| | | 'width': 30 |
| | | }) |
| | | |
| | | areaPolygon.on(global.DC.MouseEventType.CLICK, this.$parent.lineOverlayTypeClick) |
| | | }else{ |
| | | let positionObj = this.$parent.convertBillboardPositionDate(data, type) |
| | | let positionArr = data.position.slice(7, data.position.length - 2).split(',')[0].split(' ') |
| | |
| | | if('policemanId' in params){ |
| | | overlay.attrParams.data.policemanId= params.policemanId |
| | | } |
| | | |
| | | if('width' in params){ |
| | | let linePosition = '' |
| | | if('position' in params){ |
| | | linePosition = params.position.replace(/,/g, ";").replace(/ /g, ",") |
| | | }else{ |
| | | linePosition = overlay.attrParams.linePositionStr |
| | | } |
| | | let coords = global.DC.GeoTools.polylineBuffer(linePosition, params.width) |
| | | let positionStr = '' |
| | | coords.forEach((item,index) => { |
| | | if(!(index == coords.length - 1)){ |
| | | positionStr += item[0] + ',' + item[1] + ';' |
| | | } |
| | | }) |
| | | positionStr = positionStr.slice(0,positionStr.length - 1) |
| | | // 面颜色 |
| | | let color = '' |
| | | // 线颜色 |
| | | let lineColor = '' |
| | | if (params.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150) |
| | | } else { |
| | | let r = parseInt(params.color.slice(1, 3), 16) |
| | | let g = parseInt(params.color.slice(3, 5), 16) |
| | | let b = parseInt(params.color.slice(5, 7), 16) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 150) |
| | | lineColor = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255) |
| | | } |
| | | overlay.attrParams.lineObj.setStyle({ |
| | | "material": lineColor, |
| | | 'width': 3 |
| | | }) |
| | | overlay.attrParams.linePositionStr = linePosition |
| | | overlay.attrParams.polygonPositionStr = positionStr |
| | | overlay.attrParams.color = params.color |
| | | |
| | | let areaPolygon = new global.DC.Polygon(positionStr) |
| | | drawLayers.addOverlay(areaPolygon) |
| | | areaPolygon.setStyle({ |
| | | 'material': color, |
| | | 'height': 0.01, |
| | | }) |
| | | areaPolygon.attrParams = overlay.attrParams |
| | | areaPolygon.on(global.DC.MouseEventType.CLICK, this.$parent.lineOverlayTypeClick) |
| | | overlay.remove() |
| | | } |
| | | }, |
| | | |
| | | // 修改活动警车 |
| | |
| | | }) |
| | | } |
| | | |
| | | // this.$parent.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch) |
| | | }) |
| | | }, |
| | | |
| | |
| | | updateActivityPolice (params,overlay) { |
| | | updateActivityPolice(params).then(res => { |
| | | if (res.data.success) { |
| | | this.editPoliceStyle(params,overlay) |
| | | this.$message({ |
| | | message: '保存成功', |
| | | type: 'success' |
| | | }) |
| | | this.editPoliceStyle(params,overlay) |
| | | } else { |
| | | this.$message({ |
| | | message: '保存失败', |
| | | type: 'error' |
| | | }) |
| | | } |
| | | // this.getSecurityPoliceList(this.showingSecurityId, this.policeSwitch) |
| | | }) |
| | | }, |
| | | |