派生自 wuyushui/SewerAndRainNetwork

陈泽平
2021-05-30 e3608132cc667c16ea10f450807e0feddaf55d1f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
 * 污染源
 *  */
 
// 请求接口数据
const mapApi = require('../../../api/mapApi').default
// 使用封装方法
const AnimalService = require('../service/AnimalService').default
 
module.exports = function () {
  this.init = async (layer, L) => {
    this.animalService = new AnimalService({
      L: L,
      layer: layer
    })
    const result = await mapApi.getSourcesPoll()
    // console.log(result)
    const resultData = result.Result.DataInfo || []
    const polygon = L.polygon(resultData, { color: 'yellow' })
    polygon.addTo(layer)
  }
  this.bindTooltip = (layer) => {
    return 'layer'
  }
  this.click = () => {
    window.$layer.open({
      content: {
        content: 'Popup', // 组件
        data: { // 传递的参数
          datas: 'popupDatas'
        }
      },
      title: ''
    })
  }
}