| | |
| | | }, |
| | | choiceItem (itemT, indexT) { |
| | | this.Selecd = indexT |
| | | // eslint-disable-next-line no-unused-vars |
| | | const layerGroups = [] |
| | | switch (itemT.label) { |
| | | case '点标绘': |
| | | var myIcon = this.L.icon({ |
| | |
| | | iconAnchor: [13, 16], |
| | | popupAnchor: [26, -32] |
| | | }) |
| | | // eslint-disable-next-line no-case-declarations |
| | | const drawLayer = this.map.editTools.startMarker() |
| | | var drawLayer = this.map.editTools.startMarker() |
| | | drawLayer.setIcon(myIcon) |
| | | this.drawLayer.addLayer(drawLayer) |
| | | this.drawLayer.addLayer(this.setLogic(drawLayer)) |
| | | this.setLogic(drawLayer) |
| | | break |
| | | case '线标绘': |
| | | // eslint-disable-next-line no-case-declarations |
| | | const drawLayerLine = this.map.editTools.startPolyline() |
| | | var drawLayerLine = this.map.editTools.startPolyline() |
| | | this.drawLayer.addLayer(drawLayerLine) |
| | | this.setLogic(drawLayerLine) |
| | | break |
| | |
| | | this.setLogic(drawLayerPolygonJ) |
| | | break |
| | | case '圆形': |
| | | // eslint-disable-next-line no-case-declarations |
| | | const drawLayerPolygonY = this.map.editTools.startCircle() |
| | | var drawLayerPolygonY = this.map.editTools.startCircle() |
| | | this.drawLayer.addLayer(drawLayerPolygonY) |
| | | this.setLogic(drawLayerPolygonY) |
| | | break |
| | |
| | | setLogic (layer) { |
| | | layer.on('dblclick', this.L.DomEvent.stop).on('dblclick', layer.toggleEdit) |
| | | layer.setStyle({ |
| | | color: 'red' |
| | | color: 'red', |
| | | fillColor: '#ffffff', |
| | | fillOpacity: 0.1, |
| | | fill: true |
| | | }) |
| | | } |
| | | } |