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 +++-- public/static/SourcesPoll.json | 133 +++++--------------------------------------- src/api/mapUrl.js | 2 3 files changed, 28 insertions(+), 124 deletions(-) diff --git a/public/static/SourcesPoll.json b/public/static/SourcesPoll.json index 132f6bf..b4f36d6 100644 --- a/public/static/SourcesPoll.json +++ b/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 + ] ] } } \ No newline at end of file diff --git a/src/api/mapUrl.js b/src/api/mapUrl.js index 62051fd..b29d8aa 100644 --- a/src/api/mapUrl.js +++ b/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' 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