派生自 wuyushui/SewerAndRainNetwork

徐旺旺
2021-05-17 cf5ab6da9ff676fab8a10d4299bd5a04a07bf50f
src/components/LayerController/service/LayerFactory.js
@@ -1,8 +1,7 @@
import WfsLayerService from './WfsLayerService'
import { clone } from '../../../utils/utils'
import { clone, pulseEffect } from '../../../utils/utils'
import { logicMapper, SERVICE_TYPE } from '../../../conf/Constants'
import WmsLayerService from './WmsLayerService'
import AnimalService from './AnimalService'
/**
 *  init 只初始化一次
@@ -18,16 +17,17 @@
    this.layersLogic = {}
    this.minZoomLayers = {}
    this.wmsLayers = []
    this.wmsLayerService = null
    // todo 待优化,wmslayerservice调用,放这里不合适
    this.clickSwitch = true // 图层点击弹窗开关
    this.animalService = new AnimalService({ L: this.L })
    this.hightlightLayer = options.L.featureGroup({}).addTo(window.map)
  }
  init (layerConfig) {
    this.initConfig(layerConfig)
    // wms服务只需要初始化一次
    this.wmsLayerService = new WmsLayerService(this.wmsLayers)
    this.wmsLayerService = new WmsLayerService()
    this.wmsLayerService.init()
    this.initConfig(layerConfig)
  }
  initConfig (layerConfig) {
@@ -43,8 +43,8 @@
          wmsGroupLayerService.init()
          continue
        } */
        layers && this.init(config.layers)
        childLayer && this.init(config.childLayer)
        layers && this.initConfig(config.layers)
        childLayer && this.initConfig(config.childLayer)
        this.initMinZoom(config)
        this.loadLogic(config)
@@ -78,10 +78,6 @@
        logic = new BusiLayer()
      } else if (type === SERVICE_TYPE.WFS) {
        logic = new WfsLayerService(config)
      } else if (type === SERVICE_TYPE.WMS) {
        var layer = {}
        layer[config.code] = config
        this.wmsLayers.push(layer)
      }
    }
    this.layersLogic[code] = logic
@@ -225,7 +221,7 @@
      if (point.length > 2) {
        point = [point[0], point[1]]
      }
      this.animalService.pulseEffect(point.reverse())
      pulseEffect(point.reverse())
      /* var myIcon = this.L.divIcon({ className: 'my-div-icon' })
      this.L.marker(feature.geometry.coordinates.reverse(), {
        icon: myIcon