From bbce81a396e22743b1fbf0c54fed05ab79c99e72 Mon Sep 17 00:00:00 2001 From: 陈泽平 <chenzeping> Date: 星期六, 29 五月 2021 16:28:51 +0800 Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop --- src/components/LayerController/logic/EnvironmentRisk.js | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/LayerController/logic/EnvironmentRisk.js b/src/components/LayerController/logic/EnvironmentRisk.js index ae50da3..677e670 100644 --- a/src/components/LayerController/logic/EnvironmentRisk.js +++ b/src/components/LayerController/logic/EnvironmentRisk.js @@ -9,7 +9,6 @@ const echarts = require('echarts/lib/echarts') module.exports = function () { - let animalService = null // 鐜舰缁熻鍥炬暟缁� let riskLayerGroup = null @@ -18,7 +17,7 @@ * @param L leaflet瀵硅薄 */ this.init = async (layer, L) => { - animalService = new AnimalService({ + this.animalService = new AnimalService({ L: L, layer: layer }) @@ -33,7 +32,7 @@ riskLayerGroup.remove() riskLayerGroup = null } - riskLayerGroup = animalService.L.featureGroup().addTo(animalService.layer) + riskLayerGroup = this.animalService.L.featureGroup().addTo(this.animalService.layer) const result = await mapApi.getEnvironmentRisk() const features = result.features for (let i = 0; i < features.length; i++) { @@ -46,16 +45,16 @@ if (distract !== '闀挎睙娌跨嚎') { continue } - animalService.L.marker([coordinates[1], coordinates[0]], { - icon: animalService.L.divIcon({ + this.animalService.L.marker([coordinates[1], coordinates[0]], { + icon: this.animalService.L.divIcon({ className: '', iconAnchor: [15, 45], iconSize: [40, 40], html: '<div style="width: 40px; height: 40px; background-color: rgba(255,255,255,1); position: relative; border-radius: 50%;"></div>' }) }).addTo(riskLayerGroup) - animalService.L.marker([coordinates[1], coordinates[0]], { - icon: animalService.L.divIcon({ + this.animalService.L.marker([coordinates[1], coordinates[0]], { + icon: this.animalService.L.divIcon({ className: '', iconAnchor: [30, 60], iconSize: [70, 70], -- Gitblit v1.8.0