| | |
| | | const echarts = require('echarts/lib/echarts') |
| | | |
| | | module.exports = function () { |
| | | let animalService = null |
| | | // 环形统计图数组 |
| | | let riskLayerGroup = null |
| | | |
| | |
| | | * @param L leaflet对象 |
| | | */ |
| | | this.init = async (layer, L) => { |
| | | animalService = new AnimalService({ |
| | | this.animalService = new AnimalService({ |
| | | L: L, |
| | | layer: layer |
| | | }) |
| | |
| | | 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++) { |
| | |
| | | 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], |