From cf5ab6da9ff676fab8a10d4299bd5a04a07bf50f Mon Sep 17 00:00:00 2001 From: 徐旺旺 <11530253@qq.com> Date: 星期一, 17 五月 2021 10:05:53 +0800 Subject: [PATCH] 修复默认选中图层时出现的BUG --- src/components/LayerController/logic/SourcesPollution.js | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/components/LayerController/logic/SourcesPollution.js b/src/components/LayerController/logic/SourcesPollution.js index 9fd5fd6..a701f1c 100644 --- a/src/components/LayerController/logic/SourcesPollution.js +++ b/src/components/LayerController/logic/SourcesPollution.js @@ -16,14 +16,7 @@ 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) - } + const polygon = L.polygon(resultData, { color: 'yellow' }) + polygon.addTo(layer) } } -- Gitblit v1.8.0