| | |
| | | methods: { |
| | | changeChoose (index) { |
| | | this.active = index |
| | | if (this.drawLayer == null) { |
| | | this.drawLayer = this.L.layerGroup().addTo(this.map) |
| | | } |
| | | }, |
| | | changeSelect () { |
| | | this.selectGroup = !this.selectGroup |
| | |
| | | iconAnchor: [13, 16], |
| | | popupAnchor: [26, -32] |
| | | }) |
| | | this.drawLayer = this.map.editTools.startMarker() |
| | | this.drawLayer.setIcon(myIcon) |
| | | var drawLayer = this.map.editTools.startMarker() |
| | | drawLayer.setIcon(myIcon) |
| | | this.drawLayer.addLayer(drawLayer) |
| | | this.setLogic(drawLayer) |
| | | break |
| | | case '线标绘': |
| | | this.drawLayer = this.map.editTools.startPolyline() |
| | | var drawLayerLine = this.map.editTools.startPolyline() |
| | | this.drawLayer.addLayer(drawLayerLine) |
| | | this.setLogic(drawLayerLine) |
| | | break |
| | | case '多边形': |
| | | this.drawLayer = this.map.editTools.startPolygon() |
| | | var drawLayerPolygonD = this.map.editTools.startPolygon() |
| | | this.drawLayer.addLayer(drawLayerPolygonD) |
| | | this.setLogic(drawLayerPolygonD) |
| | | break |
| | | case '矩形': |
| | | this.drawLayer = this.map.editTools.startRectangle() |
| | | var drawLayerPolygonJ = this.map.editTools.startRectangle() |
| | | this.drawLayer.addLayer(drawLayerPolygonJ) |
| | | this.setLogic(drawLayerPolygonJ) |
| | | break |
| | | case '圆形': |
| | | this.drawLayer = this.map.editTools.startCircle() |
| | | var drawLayerPolygonY = this.map.editTools.startCircle() |
| | | this.drawLayer.addLayer(drawLayerPolygonY) |
| | | this.setLogic(drawLayerPolygonY) |
| | | // this.drawLayer = this.map.editTools.startCircle() |
| | | break |
| | | case '删除': |
| | | this.drawLayer.clearLayers() |
| | | break |
| | | case '距离': |
| | | Measure.startMeasureLen(this.map, this.L) |
| | |
| | | exportOnly: true, |
| | | hideControlContainer: true |
| | | }).addTo(this.map) |
| | | printer.printMap('CurrentSize', 'MyManualPrint') |
| | | printer.printMap('CurrentSize', '全屏') |
| | | break |
| | | case 'A4横向': |
| | | var printerX = this.L.easyPrint({ |
| | |
| | | exportOnly: true, |
| | | hideControlContainer: true |
| | | }).addTo(this.map) |
| | | printerX.printMap('A4Landscape page', 'MyManualPrint') |
| | | printerX.printMap('A4Landscape page', '横向') |
| | | break |
| | | case 'A4纵向': |
| | | var printerY = this.L.easyPrint({ |
| | |
| | | exportOnly: true, |
| | | hideControlContainer: true |
| | | }).addTo(this.map) |
| | | printerY.printMap('A4Portrait page', 'MyManualPrint') |
| | | break |
| | | case '删除': |
| | | this.map.removeLayer(this.drawLayer) |
| | | printerY.printMap('A4Portrait page', '纵向') |
| | | break |
| | | } |
| | | this.drawLayer.on('dblclick', this.L.DomEvent.stop).on('dblclick', this.drawLayer.toggleEdit) |
| | | this.drawLayer.setStyle({ |
| | | }, |
| | | setLogic (layer) { |
| | | layer.on('dblclick', this.L.DomEvent.stop).on('dblclick', layer.toggleEdit) |
| | | layer.setStyle({ |
| | | color: 'red', |
| | | fillColor: '#ffffff', |
| | | fillOpacity: 0.1, |