| | |
| | | let analysePolygon = null |
| | | let drawLayers = null |
| | | let drawArrowLayers = null |
| | | let arrowsListLayer = null |
| | | let plot = undefined |
| | | let arrowPlot = undefined |
| | | let tc = undefined |
| | |
| | | global.viewer.addLayer(drawArrowLayers) |
| | | arrowPlot = new global.DC.Plot(global.viewer) |
| | | } |
| | | |
| | | if (arrowsListLayer == null) { |
| | | arrowsListLayer = new global.DC.VectorLayer('arrowsListLayer') |
| | | global.viewer.addLayer(arrowsListLayer) |
| | | } |
| | | |
| | | // 轨迹 |
| | | let positions = "116.023042, 28.684732; 116.023402, 28.679067; 116.023475, 28.678843; 116.023697, 28.678647; 116.024121, 28.678391; 116.026906, 28.678461; 116.027065, 28.676867; 116.033252, 28.676165" |
| | | tc = new global.DC.TrackController(global.viewer) |
| | |
| | | // 点击活动列表活动 |
| | | activityListClick (item, index) { |
| | | this.removeAll() |
| | | this.removeAllArrow() |
| | | arrowsListLayer.clear() |
| | | this.showingSecurityId = item.id |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newDrawLayers', |
| | |
| | | } |
| | | |
| | | if (overlay) { |
| | | |
| | | drawLayers.addOverlay(overlay) |
| | | plot.edit(overlay, (e) => { |
| | | flag = true |
| | |
| | | drawArrow (type) { |
| | | arrowPlot && arrowPlot.draw(type, overlay => { |
| | | if (overlay) { |
| | | console.log(overlay._positions, 123) |
| | | let plotType = '' |
| | | if (type == 'attack_arrow') { |
| | | plotType = 1 |
| | |
| | | }) |
| | | position = position.slice(0, position.length - 1) |
| | | console.log(position, 123445) |
| | | |
| | | |
| | | |
| | | |
| | | drawArrowLayers.addOverlay(overlay) |
| | | plot.edit(overlay, (e) => { |
| | | this.addSecurityPlot(this.showingSecurityId, '102.371 35.0049,102.249 33.8775,102.227 33.9519,102.34 35.0212', '1') |
| | | this.addSecurityPlot(this.showingSecurityId, position, plotType) |
| | | }) |
| | | } |
| | | }) |
| | |
| | | // 保存活动标绘箭头 |
| | | addSecurityPlot (securityId, position, type) { |
| | | addSecurityPlot(securityId, position, type).then(res => { |
| | | console.log(res, '保存标绘返回值') |
| | | this.getSecurityPlotList(securityId) |
| | | }) |
| | | }, |
| | | |
| | | // 获取活动标绘箭头列表 |
| | | getSecurityPlotList (securityId) { |
| | | arrowsListLayer.clear() |
| | | getSecurityPlotList(securityId).then(res => { |
| | | console.log(res, '标绘列表') |
| | | res.data.data.forEach(item => { |
| | | let position = item.position.slice(11, item.position.length - 1).replace(/,/g, ';').replace(/ /g, ',') |
| | | let chooseArrow = null |
| | | console.log(position, 2323) |
| | | if (item.type == 1) { |
| | | chooseArrow = new global.DC.AttackArrow(position) |
| | | } else if (item.type == 2) { |
| | | chooseArrow = new global.DC.DoubleArrow(position) |
| | | } else if (item.type == 3) { |
| | | chooseArrow = new global.DC.FineArrow(position) |
| | | } else if (item.type == 4) { |
| | | chooseArrow = new global.DC.TailedAttackArrow(position) |
| | | } |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | chooseArrow.setStyle({ |
| | | "material": global.DC.Color.RED, |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | |
| | | }) |
| | | |
| | | analyseLayer.clear() |
| | | arrowsListLayer.clear() |
| | | |
| | | this.removeAll() |
| | | this.removeAllArrow() |
| | | tc.clear() |
| | | |
| | | this.$parent.$parent.resize('0px') |