派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-04-07 05f6eb0aaa7914289b60e87ee7fdc2aa357b36cb
src/components/LayerController/logic/Company.js
@@ -28,33 +28,44 @@
      const positionY = data[i].Longitude
      var iconUrl = companyImg
      const marker = L.marker.magic([positionX, positionY], {
      const marker = L.marker([positionX, positionY], {
        icon: L.icon({
          iconUrl: iconUrl,
          iconSize: [50, 50],
          iconAnchor: [25, 25]
          iconSize: [30, 30],
          iconAnchor: [13, 5]
        }),
        test: data[i]
      })
      marker.bindTooltip(data[i].name, {
        permanent: true,
        offset: [0, -16],
        direction: 'top',
        className: ''
        offset: [0, 14],
        direction: 'bottom',
        className: 'company-bindTooltip'
      })
      layer.addLayer(marker)
    }
  }
  /*
  * 点位鼠标移入弹框
  * */
  this.bindTooltip = (layer) => {
    // console.log(layer)
    // return layer.options.test.name
    console.log(layer)
    return '<div class="company-bindTooltip-hover"><h3>污染物产生统计</h3><ul>' +
                '<li>生产设施:30(个)</li>' +
                '<li>治理设施:30(个)</li>' +
            '</ul></div>'// layer.options.test.name
  }
  /*
  * 点位点击事件
  *
  * */
  this.clickListener = (e) => {
    // this.animalService.pulseEffect(e.latlng)
    console.log(e)
    const dataValue = {
      StoragePlaceId: e.layer.options.test.name
    }
    debugger
    console.log(dataValue)
    // return this.PublicBounced.$el
  }
}