From 2219d26b186bd56616fa9b45432837378c894551 Mon Sep 17 00:00:00 2001 From: wangqi <magical1908@outlook.com> Date: 星期三, 31 三月 2021 16:01:11 +0800 Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop --- src/components/LayerController/logic/Sample.js | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 40 insertions(+), 4 deletions(-) diff --git a/src/components/LayerController/logic/Sample.js b/src/components/LayerController/logic/Sample.js index 063123f..20fe78f 100644 --- a/src/components/LayerController/logic/Sample.js +++ b/src/components/LayerController/logic/Sample.js @@ -1,9 +1,45 @@ +/** + * 搴熸皵 + */ +const AnimalService = require('../service/AnimalService').default +const AjaxUtils = require('../../../utils/AjaxUtils').default + module.exports = function () { - this.init = (L) => { - console.log('sample init !!!') + /** + * 杩斿洖marker瀵硅薄鏁扮粍 + * @param L leaflet瀵硅薄 + */ + this.init = (layer, L) => { + this.animalService = new AnimalService({ L: L, layer: layer }) + AjaxUtils.get4JsonDataByUrl('http://10.246.162.140:8080/EPInterface/DataService/EPMapService.asmx/ObtainningConInfo', { + companyId: 3900100145, + id: '', + monType: 1, + userCode: 'wenchun.deng', + monDuration: '', + epName: '', + secdDeptId: '', + contrLevel: '', + dataStatus: '', + dataFlag: '', + runStatus: '', + emissTypeId: '' + }, function (res) { + const data = res.data.Result.DataInfo + for (let i = 0; i < data.length; i++) { + // 缁忕含搴� 浣嶇疆 + const positionX = data[i].Latitude + const positionY = data[i].Longitude + layer.addLayer(L.marker([positionX, positionY], { test: '122224' })) + } + }) } - this.clickListener = (e, data) => { - console.log('sample clickListener !!!') + this.bindTooltip = (layer) => { + return layer.options.test + } + + this.clickListener = (e) => { + this.animalService.pulseEffect(e.latlng) } } -- Gitblit v1.8.0