| | |
| | | isShow: true, |
| | | currentBaseMapCode: 'tianditu_img', |
| | | basemapList: [], |
| | | selectGroup: false, |
| | | drawLayer: null, |
| | | map: null, |
| | | active: -1, |
| | | Selecd: -1, |
| | | menuList: [ |
| | | { |
| | | icon: plot, |
| | |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | ], |
| | | selectGroup: false, |
| | | drawLayer: null, |
| | | drawLayerArray: [], |
| | | map: null, |
| | | // L: window.L, |
| | | active: -1, |
| | | Selecd: -1 |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | console.log('取消当前选中状态') |
| | | } |
| | | this.active = index |
| | | if (this.drawLayer == null) { |
| | | this.drawLayer = this.L.layerGroup().addTo(this.map) |
| | | } |
| | | }, |
| | | choiceItem (itemT, indexT) { |
| | | this.Selecd = indexT |
| | |
| | | iconAnchor: [13, 16], |
| | | popupAnchor: [26, -32] |
| | | }) |
| | | var drawLayerMarker = this.map.editTools.startMarker() |
| | | drawLayerMarker.setIcon(myIcon) |
| | | this.drawLayer.addLayer(drawLayerMarker) |
| | | this.setLogic(drawLayerMarker) |
| | | this.drawLayer = this.map.editTools.startMarker() |
| | | this.drawLayer.setIcon(myIcon) |
| | | this.drawLayerArray.push(this.drawLayer) |
| | | break |
| | | case '线标绘': |
| | | var drawLayerLine = this.map.editTools.startPolyline() |
| | | this.drawLayer.addLayer(drawLayerLine) |
| | | this.setLogic(drawLayerLine) |
| | | this.drawLayer = this.map.editTools.startPolyline() |
| | | this.drawLayerArray.push(this.drawLayer) |
| | | this.setLogic() |
| | | break |
| | | case '多边形': |
| | | var drawLayerPolygonD = this.map.editTools.startPolygon() |
| | | this.drawLayer.addLayer(drawLayerPolygonD) |
| | | this.setLogic(drawLayerPolygonD) |
| | | this.drawLayer = this.map.editTools.startPolygon() |
| | | this.drawLayerArray.push(this.drawLayer) |
| | | this.setLogic() |
| | | break |
| | | case '矩形': |
| | | var drawLayerPolygonJ = this.map.editTools.startRectangle() |
| | | this.drawLayer.addLayer(drawLayerPolygonJ) |
| | | this.setLogic(drawLayerPolygonJ) |
| | | this.drawLayer = this.map.editTools.startRectangle() |
| | | this.drawLayerArray.push(this.drawLayer) |
| | | this.setLogic() |
| | | break |
| | | case '圆形': |
| | | var drawLayerPolygonY = this.map.editTools.startCircle() |
| | | this.drawLayer.addLayer(drawLayerPolygonY) |
| | | this.setLogic(drawLayerPolygonY) |
| | | this.drawLayer = this.map.editTools.startCircle() |
| | | this.drawLayerArray.push(this.drawLayer) |
| | | this.setLogic() |
| | | break |
| | | case '删除': |
| | | this.drawLayer.clearLayers() |
| | | for (let i = 0; i < this.drawLayerArray.length; i++) { |
| | | this.map.removeLayer(this.drawLayerArray[i]) |
| | | } |
| | | break |
| | | case '清除': |
| | | Measure.clearMeasure(this.map, this.L) |
| | |
| | | break |
| | | } |
| | | }, |
| | | setLogic (layer) { |
| | | layer.on('dblclick', this.L.DomEvent.stop).on('dblclick', layer.toggleEdit) |
| | | layer.setStyle({ |
| | | color: 'yellow' |
| | | setLogic () { |
| | | this.drawLayer.on('dblclick', this.L.DomEvent.stop).on('dblclick', this.drawLayer.toggleEdit) |
| | | this.drawLayer.setStyle({ |
| | | color: 'red' |
| | | }) |
| | | }, |
| | | changeSelect () { |