派生自 wuyushui/SewerAndRainNetwork

ChenZeping02609
2021-05-12 68b02f600f315550d69289c5980fc2f182ec5439
src/components/LayerController/service/WmsLayerGroupService.js
File was renamed from src/components/LayerController/service/WmsGroupLayerService.js
@@ -4,7 +4,7 @@
/**
 * wms 图层组的管理
 */
class WmsGroupLayerService {
class WmsLayerGroupService {
  constructor (config) {
    this.config = config
    this.L = window.L
@@ -13,8 +13,18 @@
    this.map = window.map
    this.popupComp = window.popupComp
    // {groupName:{url:'.../wms',layers:[]}}
    this.groups = []
    this.map.on('click', (e) => this.click(e))
  }
  load () {
    for (var k in this.groups) {
      console.log(k)
      this.L.tileLayer.wms(PIPELINE_WMS, {
        format: 'image/png', // 返回的数据格式
        transparent: true,
        layers: k // todo
      }).addTo(this.layer).bringToFront()
    }
  }
  init () {
@@ -53,17 +63,6 @@
          layers: [layerName]
        }
      }
    }
  }
  load () {
    for (var k in this.groups) {
      console.log(k)
      this.L.tileLayer.wms(PIPELINE_WMS, {
        format: 'image/png', // 返回的数据格式
        transparent: true,
        layers: k // todo
      }).addTo(this.layer).bringToFront()
    }
  }
@@ -114,4 +113,4 @@
  }
}
export default WmsGroupLayerService
export default WmsLayerGroupService