派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-03-16 dcd10e4906fd6f903c35791f591833b8f26af1e8
src/components/panel/ToolBoxPanel.vue
@@ -250,13 +250,15 @@
            iconAnchor: [13, 16],
            popupAnchor: [26, -32]
          })
          var drawLayer = this.map.editTools.startMarker()
          // eslint-disable-next-line no-case-declarations
          const drawLayer = this.map.editTools.startMarker()
          drawLayer.setIcon(myIcon)
          this.drawLayer.addLayer(drawLayer)
          this.setLogic(drawLayer)
          this.drawLayer.addLayer(this.setLogic(drawLayer))
          break
        case '线标绘':
          var drawLayerLine = this.map.editTools.startPolyline()
          // eslint-disable-next-line no-case-declarations
          const drawLayerLine = this.map.editTools.startPolyline()
          this.drawLayer.addLayer(drawLayerLine)
          this.setLogic(drawLayerLine)
          break
@@ -271,9 +273,13 @@
          this.setLogic(drawLayerPolygonJ)
          break
        case '圆形':
          var drawLayerPolygonY = this.map.editTools.startCircle()
          // eslint-disable-next-line no-case-declarations
          const drawLayerPolygonY = this.map.editTools.startCircle()
          this.drawLayer.addLayer(drawLayerPolygonY)
          this.setLogic(drawLayerPolygonY)
          break
        case '删除':
          this.drawLayer.clearLayers()
          break
        case '距离':
          Measure.startMeasureLen(this.map, this.L)
@@ -289,7 +295,7 @@
            exportOnly: true,
            hideControlContainer: true
          }).addTo(this.map)
          printer.printMap('CurrentSize', 'MyManualPrint')
          printer.printMap('CurrentSize', '全屏')
          break
        case 'A4横向':
          var printerX = this.L.easyPrint({
@@ -298,7 +304,7 @@
            exportOnly: true,
            hideControlContainer: true
          }).addTo(this.map)
          printerX.printMap('A4Landscape page', 'MyManualPrint')
          printerX.printMap('A4Landscape page', '横向')
          break
        case 'A4纵向':
          var printerY = this.L.easyPrint({
@@ -307,21 +313,14 @@
            exportOnly: true,
            hideControlContainer: true
          }).addTo(this.map)
          printerY.printMap('A4Portrait page', 'MyManualPrint')
          break
        case '删除':
          // this.map.removeLayer(this.drawLayer)
          this.drawLayer.clearLayers()
          printerY.printMap('A4Portrait page', '纵向')
          break
      }
    },
    setLogic (layer) {
      layer.on('dblclick', this.L.DomEvent.stop).on('dblclick', layer.toggleEdit)
      layer.setStyle({
        color: 'red',
        fillColor: '#ffffff',
        fillOpacity: 0.1,
        fill: true
        color: 'red'
      })
    }
  }