派生自 wuyushui/SewerAndRainNetwork

ChenZeping02609
2021-05-12 f9f80893f6b29f0aaa8d5f7c1291f91b8f477fe4
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,17 @@
      L: L,
      layer: layer
    })
    // getSourcesPoll().then(res => {
    //   console.log(res)
    // })
    const result = await mapApi.getSourcesPoll()
    console.log(result)
    const resultData = result.Result.DataInfo || []
    console.log(resultData)
    // 循环遍历数据 根据进行marker 的创建
    for (let i = 0; i < resultData.length; i++) {
      const polygon = L.polygon(resultData, {
        // totransferData: resultData[i],
        color: 'red'
      })
      layer.addLayer(polygon)
    }
  }
}