File was renamed from src/components/LayerController/service/WmsGroupLayerService.js |
| | |
| | | /** |
| | | * wms 图层组的管理 |
| | | */ |
| | | class WmsGroupLayerService { |
| | | class WmsLayerGroupService { |
| | | constructor (config) { |
| | | this.config = config |
| | | this.L = window.L |
| | |
| | | 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 () { |
| | |
| | | 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() |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | export default WmsGroupLayerService |
| | | export default WmsLayerGroupService |