派生自 wuyushui/SewerAndRainNetwork

seatonwan9
2021-05-30 cca4ca2151f5f2c721662691f2ff5eb4f27147bb
新增治理设施测试
1个文件已删除
1个文件已添加
96 ■■■■■ 已修改文件
src/components/LayerController/logic/GovernEquipment.js 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/logic/SourcesPollution.js 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/logic/GovernEquipment.js
New file
@@ -0,0 +1,60 @@
/**
 * 污染源
 */
// 信息组件
// const SourcePollutionIndex = require('../../base-page/RiskSource/RiskSourceIndex.vue').default
// 使用封装方法
const AnimalService = require('../service/AnimalService').default
// 请求接口数据
const mapApi = require('../../../api/mapApi').default
// 公共方法 panTo() 引用
// const { setPanTo } = require('../../../utils/utils')
module.exports = function () {
  /**
   * 初始化并加载图层
   * @param L leaflet对象
   */
  this.init = async (layer, L) => {
    this.animalService = new AnimalService({
      L: L,
      layer: layer
    })
    const result = await mapApi.getEnvironmentRiskPoint()
    const data = result[0]
    for (let i = 0; i < data.length; i++) {
      const postion = [data[i].Latitude, data[i].Longitude] // 坐标
      const iconUrl = this.sourcePollutionIconUrl(1) // 治理设施图标
      const marker = L.marker(postion, {
        totransferData: data[i],
        icon: L.icon({
          iconUrl: iconUrl,
          iconSize: [20, 20],
          iconAnchor: [10, 10]
        })
      })
      layer.addLayer(marker)
    }
  }
  /**
   * 治理设施图标配置
   * @param t
   * @returns {string}
   */
  this.sourcePollutionIconUrl = (t) => {
    let iconUrl = null
    switch (t) {
      case 1:
        iconUrl = ''
        break
      case 2:
        iconUrl = ''
        break
      default:
        iconUrl = ''
        break
    }
    return iconUrl
  }
}
src/components/LayerController/logic/SourcesPollution.js
File was deleted