| | |
| | | const echarts = require('echarts/lib/echarts') |
| | | |
| | | module.exports = function () { |
| | | // 存放环形图的数组 |
| | | let riskLayerGroup = [] |
| | | /** |
| | | * 返回marker对象数组 |
| | | * @param L leaflet对象 |
| | |
| | | L: L, |
| | | layer: layer |
| | | }) |
| | | layer.addLayer(riskLayerGroup) |
| | | } |
| | | |
| | | this.start = async () => { |
| | | riskLayerGroup = window.layerFactory.L.featureGroup().addTo(window.layerFactory.map) |
| | | const result = await mapApi.getRiskEnterprise() |
| | | const features = result.features |
| | | for (var i = 0; i < features.length; i++) { |
| | |
| | | if (distract !== '长江沿线') { |
| | | continue |
| | | } |
| | | const bgMarker = L.marker([coordinates[1], coordinates[0]], { |
| | | icon: L.divIcon({ |
| | | window.layerFactory.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>' |
| | | }) |
| | | }) |
| | | layer.addLayer(bgMarker) |
| | | const chartMarker = L.marker([coordinates[1], coordinates[0]], { |
| | | icon: L.divIcon({ |
| | | }).addTo(riskLayerGroup) |
| | | // this.animalService.layer.addLayer(bgMarker) |
| | | window.layerFactory.L.marker([coordinates[1], coordinates[0]], { |
| | | icon: this.animalService.L.divIcon({ |
| | | className: '', |
| | | iconAnchor: [30, 60], |
| | | iconSize: [70, 70], |
| | | html: '<div id="qy_id_' + qyId + '" style="width: 70px; height: 70px; background-color: transparent; position: relative; border-radius: 50%;"></div>' |
| | | }) |
| | | }) |
| | | layer.addLayer(chartMarker) |
| | | }).addTo(riskLayerGroup) |
| | | chartRender(properties) |
| | | } |
| | | } |
| | | |
| | | this.destory = () => { |
| | | if (riskLayerGroup) { |
| | | riskLayerGroup.remove() |
| | | } |
| | | } |
| | | |
| | |
| | | * @returns {string} |
| | | */ |
| | | this.bindTooltip = (layer) => { |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param e |
| | | */ |
| | | this.clickListener = (e) => { |
| | | |
| | | } |
| | | |
| | | /** |