派生自 wuyushui/SewerAndRainNetwork

陈泽平
2021-05-17 db929db466201b100a5af70add4a8f6b46bb8b5d
src/components/LayerController/logic/Company.js
@@ -1,6 +1,7 @@
/**
 * 固废
 * 企业
 */
// 区分不同类型 使用不同img
const companyImg = '/assets/images/map/company_refining.png'
const companyOil = '/assets/images/map/company_oil.png'
@@ -13,8 +14,8 @@
   * 返回marker对象数组
   * @param L leaflet对象
   */
  this.init = async (layer, L) => {
    // const SolidWasteIcon = this.SolidWasteIcon()
    this.animalService = new AnimalService({
      L: L,
      layer: layer
@@ -56,30 +57,41 @@
        direction: 'bottom',
        className: 'company-bindTooltip'
      }) */
      layer.addLayer(marker)
      // layer.addLayer(marker)
      if (window.map.getZoom() <= 5) {
        layer.addLayer(marker)
      } else if (window.map.getZoom() >= 12) {
        layer.removeLayer()
      }
    }
  }
  /*
  * 点位鼠标移入弹框
  * */
  this.bindTooltip = (layer) => {
  //  console.log(layer)
    //  console.log(layer)
    return '<div class="company-bindTooltip-hover"><h3>污染物产生统计</h3><ul>' +
                '<li>生产设施:30(个)</li>' +
                '<li>治理设施:30(个)</li>' +
            '</ul></div>'// layer.options.test.name
      '<li>生产设施:30(个)</li>' +
      '<li>治理设施:30(个)</li>' +
      '</ul></div>'// layer.options.test.name
  }
  /*
  * 点位点击事件
  *
  * */
  this.clickListener = (e) => {
    // this.animalService.pulseEffect(e.latlng)
    const dataValue = {
      StoragePlaceId: e.layer.options.test.name
    console.log(e)
    window.map.setView(e.latlng, 13)
    if (window.map.getZoom() >= 12) {
      e.layer.remove()
    }
    debugger
    console.log(dataValue)
    // return this.PublicBounced.$el
    // if (window.map.getZoom() <= 5) {
    //   e.layer.addLayer()
    // } else if (window.map.getZoom() >= 12) {
    //   e.layer.removeLayer()
    // }
    // const dataValue = {
    //   StoragePlaceId: e.layer.options.test.name
    // }
  }
}