派生自 wuyushui/SewerAndRainNetwork

徐旺旺
2021-05-30 484bd662e2fd4461ef34dbf9d64106c12b3ef961
src/components/LayerController/logic/SourcesPollution.js
@@ -2,11 +2,9 @@
 * 污染源
 *  */
// 使用封装方法
// 请求接口数据
// import { getSourcesPoll } from '../../../api/request'
const mapApi = require('../../../api/mapApi').default
// 使用封装方法
const AnimalService = require('../service/AnimalService').default
module.exports = function () {
@@ -15,10 +13,24 @@
      L: L,
      layer: layer
    })
    // getSourcesPoll().then(res => {
    //   console.log(res)
    // })
    const result = await mapApi.getSourcesPoll()
    console.log(result)
    // 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: ''
    })
  }
}