From f9f80893f6b29f0aaa8d5f7c1291f91b8f477fe4 Mon Sep 17 00:00:00 2001
From: ChenZeping02609 <chenzeping02609@163.com>
Date: 星期三, 12 五月 2021 18:21:01 +0800
Subject: [PATCH] 污染源修改

---
 src/components/LayerController/logic/SourcesPollution.js |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/components/LayerController/logic/SourcesPollution.js b/src/components/LayerController/logic/SourcesPollution.js
index 6cec839..9fd5fd6 100644
--- a/src/components/LayerController/logic/SourcesPollution.js
+++ b/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)
+    }
   }
 }

--
Gitblit v1.8.0