派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-03-31 55e6c16ceea8b2f2f6d7eb797e05928fb3f92f3b
src/components/LayerController/logic/WasteGas.js
@@ -11,13 +11,17 @@
const ImagBright = '/assets/images/map/exhaust/fq_bright_green.png'
const mapApi = require('../../../api/mapApi').default
const publicBounced = require('../../BaseNav/PublicBounced/PublicBounced').default
module.exports = function () {
  /**
   * 返回marker对象数组
   * @param L leaflet对象
   */
  this.init = async (layer, L) => {
    this.animalService = new AnimalService({ L: L, layer: layer })
    this.animalService = new AnimalService({
      L: L,
      layer: layer
    })
    const res = await mapApi.GetWasteGas()
    const data = res.Result.DataInfo || {}
    console.log(data)
@@ -30,9 +34,10 @@
      var iconUrl = this.differentTypes(ContrLevel)
      const marker = L.marker.magic([positionX, positionY], {
        test: data[i],
        icon: L.icon({
          iconUrl: iconUrl,
          iconSize: [50, 50],
          iconSize: [20, 20],
          iconAnchor: [25, 25]
        })
      })
@@ -42,15 +47,23 @@
  }
  this.bindTooltip = (layer) => {
    console.log(layer)
    return '测试废气'
    return layer.options.test.Name
  }
  this.clickListener = (e) => {
    console.log(e)
  this.clickListener = async (e) => {
    // console.log(e)
    this.animalService.pulseEffect(e.latlng)
    const dataValue = {
      StoragePlaceId: e.layer.options.test.StoragePlaceId
    }
    const result = await mapApi.GetWasteGas(dataValue)
    const PublicBounced = window.Vue.extend(publicBounced)
    const instance = new PublicBounced()
    instance.setData(result)
    instance.$mount()
    document.body.appendChild(instance.$el)
  }
  // 不同类型图片封装
  // 不同类型图片加载
  this.differentTypes = (ContrLevel) => {
    var effectOfChange
    if (ContrLevel === 1) {