派生自 wuyushui/SewerAndRainNetwork

ChenZeping
2021-05-10 315dc0b82a482a3d145009c8f25c20e87da681d5
src/components/panel/topicSearch/SewersSelect/AnalysisChoose/DrawLine.js
@@ -31,18 +31,15 @@
    mousemove = (e) => {
      this.points.push(e.latlng)
      if (this.polyline) { this.map.removeLayer(this.polyline) }
      this.polyline = L.polyline(this.points, { showMeasurements: true, color: 'red' })
      this.polyline = L.polyline(this.points, { showMeasurements: false, color: 'red' })
      this.polyline.addTo(this.layers)
      this.layers.addTo(this.map)
      this.points.pop()
    }
    dbClick = (e) => {
      // console.log('双击结束', e)
      this.polyline.addTo(this.layers)
      // this.close(e.latlng);
      this.map.off('click', this.click).off('mousemove', this.mousemove).off('dblclick', this.dbClick)
      // console.log(this.points)
      eventBus.$emit('draw-hdm-line', this.points)
    }