派生自 wuyushui/SewerAndRainNetwork

wangqi
2021-04-07 9e3fe61241b6c6c0a8527a0a0812f585f3ed66ae
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)
  }
}