/** * 废气 */ const AnimalService = require('../service/AnimalService').default const AjaxUtils = require('../../../utils/AjaxUtils').default module.exports = function () { /** * 返回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], {})) } }) } this.bindTooltip = (layer) => { return '测试废气' } this.clickListener = (e) => { console.log(e) this.animalService.pulseEffect(e.latlng) } }