| | |
| | | /** |
| | | * 废气 |
| | | */ |
| | | const AnimalService = require('../service/AnimalService').default |
| | | const AjaxUtils = require('../../../utils/AjaxUtils').default |
| | | |
| | | module.exports = function () { |
| | | this.init = (layer) => { |
| | | 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 = (list) => { |
| | | console.log('sample clickListener !!!') |
| | | this.bindTooltip = (layer) => { |
| | | return layer.options.test |
| | | } |
| | | |
| | | this.clickListener = (e) => { |
| | | this.animalService.pulseEffect(e.latlng) |
| | | } |
| | | } |