派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-04-01 1602bcb0af9757e6d3af0b509060c4c0a40e1ba8
src/components/LayerController/logic/SolidWaste.js
@@ -43,6 +43,12 @@
          iconAnchor: [25, 25]
        })
      })
      marker.bindTooltip(getSolidWasteData[i].Name, {
        permanent: true,
        offset: [0, 14],
        direction: 'bottom',
        className: 'company-bindTooltip'
      })
      layer.addLayer(marker)
    }
  }
@@ -54,8 +60,6 @@
  this.clickListener = (e) => {
    // 点击marker的pulse()光波
    this.animalService.pulseEffect(e.latlng)
    /* flyTo()弹出框平移事件 */
    // this.setPanTo(e.latlng, 200)
    /* 点击数据的接口请求 */
    this.requestSolidWasteData(e).then(e)
  }
@@ -86,14 +90,16 @@
    instance.$mount()
    document.body.appendChild(instance.$el)
    instance.setData(resultBasic.Result.DataInfo, resultDetailed, 'gufei')
    /* flyTo()弹出框平移事件 */
    this.setPanTo(e.latlng, 200)
  }
  // flayTo()
  // this.setPanTo = (pos, value) => {
  //   var position = pos
  //   position = this.map.latLngToLayerPoint(position)
  //   position.y += value
  //   position = this.map.layerPointToLatLng(position)
  //   this.map.flyTo(position)
  // }
  this.setPanTo = (pos, value) => {
    var position = pos
    position = window.map.latLngToLayerPoint(position)
    position.y += value
    position = window.map.layerPointToLatLng(position)
    window.map.flyTo(position)
  }
}