派生自 wuyushui/SewerAndRainNetwork

ChenZeping02609
2021-05-12 f9f80893f6b29f0aaa8d5f7c1291f91b8f477fe4
污染源修改
3个文件已修改
152 ■■■■ 已修改文件
public/static/SourcesPoll.json 133 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mapUrl.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/logic/SourcesPollution.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/static/SourcesPoll.json
@@ -3,123 +3,22 @@
    "IsSuccess": 1,
    "ErrorMsg": "",
    "DataInfo": [
      {
        "StoragePlaceId": 0,
        "Name": "巴陵石化 取水单元干泥暂存库",
        "StorageQtyMax": 0,
        "Longitude": 113.38361,
        "Latitude": 29.9008,
        "SortNum": 0,
        "DesignFloorArea": 0,
        "VideoCoding": null,
        "VideoURL": null,
        "DaysAlarm": 0,
        "MarginAlarm": 0
      },
      {
        "StoragePlaceId": 1,
        "Name": "巴陵石化 吉家湖灰塘",
        "StorageQtyMax": 0,
        "Longitude": 113.14089,
        "Latitude": 29.4181,
        "SortNum": 0,
        "DesignFloorArea": 0,
        "VideoCoding": null,
        "VideoURL": null,
        "DaysAlarm": 0,
        "MarginAlarm": 0
      },
      {
        "StoragePlaceId": 2,
        "Name": "长岭炼化 八字门垃圾填埋场",
        "StorageQtyMax": 0,
        "Longitude": 113.3916666667,
        "Latitude": 29.6394444444,
        "SortNum": 0,
        "DesignFloorArea": 0,
        "VideoCoding": null,
        "VideoURL": null,
        "DaysAlarm": 0,
        "MarginAlarm": 0
      },
      {
        "StoragePlaceId": 3,
        "Name": "中韩石化 灰渣场",
        "StorageQtyMax": 0,
        "Longitude": 114.5192083333,
        "Latitude": 30.6201666667,
        "SortNum": 0,
        "DesignFloorArea": 0,
        "VideoCoding": null,
        "VideoURL": null,
        "DaysAlarm": 0,
        "MarginAlarm": 0
      },
      {
        "StoragePlaceId": 4,
        "Name": "安庆石化 山口废渣填埋场",
        "StorageQtyMax": 0,
        "Longitude": 116.960599,
        "Latitude": 30.541509,
        "SortNum": 0,
        "DesignFloorArea": 0,
        "VideoCoding": null,
        "VideoURL": null,
        "DaysAlarm": 0,
        "MarginAlarm": 0
      },
      {
        "StoragePlaceId": 5,
        "Name": "安庆石化 热电陈家冲灰场",
        "StorageQtyMax": 0,
        "Longitude": 116.986949,
        "Latitude": 30.534486,
        "SortNum": 0,
        "DesignFloorArea": 0,
        "VideoCoding": null,
        "VideoURL": null,
        "DaysAlarm": 0,
        "MarginAlarm": 0
      },
      {
        "StoragePlaceId": 6,
        "Name": "高桥石化 海滨码头附近滩涂",
        "StorageQtyMax": 0,
        "Longitude": 121.55,
        "Latitude": 31.63,
        "SortNum": 0,
        "DesignFloorArea": 0,
        "VideoCoding": null,
        "VideoURL": null,
        "DaysAlarm": 0,
        "MarginAlarm": 0
      },
      {
        "StoragePlaceId": 7,
        "Name": "川维化工 生化污泥料仓",
        "StorageQtyMax": 0,
        "Longitude": 107.02342004,
        "Latitude": 29.79235333,
        "SortNum": 0,
        "DesignFloorArea": 0,
        "VideoCoding": null,
        "VideoURL": null,
        "DaysAlarm": 0,
        "MarginAlarm": 0
      },
      {
        "StoragePlaceId": 8,
        "Name": "川维化工 排泥水泥饼料仓",
        "StorageQtyMax": 0,
        "Longitude": 107.02315181,
        "Latitude": 29.78832166,
        "SortNum": 0,
        "DesignFloorArea": 0,
        "VideoCoding": null,
        "VideoURL": null,
        "DaysAlarm": 0,
        "MarginAlarm": 0
      }
      [
        116.38927817344666,
        39.90751504898071
      ],
      [
        116.38689637184143,
        39.9088454246521
      ],
      [
        116.39344096183777,
        39.90931749343872
      ],
      [
        116.39116644859314,
        39.90489721298218
      ]
    ]
  }
}
src/api/mapUrl.js
@@ -37,4 +37,4 @@
export const getCrossSection = $HOSTANALYSE + '/getCrossSection'
// 污染源
export const getSourcesPoll = 'http://localhost:8081/static/SourcesPoll.json'
export const getSourcesPoll = 'http://localhost:8080/static/SourcesPoll.json'
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)
    }
  }
}