派生自 wuyushui/SewerAndRainNetwork

陈泽平
2021-05-30 42a5c3a7bf9f65d4003d800b6efa3769018f1bc3
src/components/base-page/enterprise-emergency/events-reported/ReportLocationPoint.vue
@@ -64,7 +64,8 @@
        longPos: '',
        latPos: ''
      },
      marker: null
      marker: window.L.layerGroup().addTo(window.map),
      layersGroupArrList: []
    }
  },
  methods: {
@@ -85,6 +86,7 @@
          })
        })
        window.map.addLayer(this.marker)
        this.layersGroupArrList.push(this.marker)
        window.map.off('click')
      })
    },
@@ -99,19 +101,23 @@
        this.marker = window.L.marker(as, {
          icon: window.L.icon({
            iconUrl: iconUrl,
            iconSize: [30, 40],
            iconAnchor: [15, 20]
            iconSize: [26, 40],
            iconAnchor: [13, 20]
          })
        })
        window.map.addLayer(this.marker)
        this.layersGroupArrList.push(this.marker)
      } else {
        this.$message('请输入识取经纬度')
      }
    },
    // 点击确认按钮事件
    confirm () {
      for (let i = 0; i < this.layersGroupArrList.length; i++) {
        window.map.removeLayer(this.layersGroupArrList[i])
      }
      window.mapManager.clearHighlight()
      window.map.removeLayer(this.marker)
      // window.map.removeLayer(this.marker)
      eventBus.$emit('location-setChange', true)
      this.lonlatpos.longPos = ''
      this.lonlatpos.latPos = ''