| | |
| | | init () { |
| | | } |
| | | |
| | | addAll (configs) { |
| | | for (let i = 0; i < configs.length; i++) { |
| | | const config = configs[i] |
| | | const layers = config.layers |
| | | if (layers) { |
| | | this.addAll(layers) |
| | | } |
| | | this.wmsLayerList.addConfig(config) |
| | | } |
| | | this.reload() |
| | | } |
| | | |
| | | add (config) { |
| | | this.wmsLayerList.addConfig(config) |
| | | this.reload() |
| | | } |
| | | |
| | | removeAll (configs) { |
| | | for (let i = 0; i < configs.length; i++) { |
| | | const config = configs[i] |
| | | const layers = config.layers |
| | | if (layers) { |
| | | this.removeAll(layers) |
| | | } |
| | | this.wmsLayerList.remove(config.typeName, config.filter) |
| | | } |
| | | this.reload() |
| | | } |
| | | |
| | | remove (config) { |
| | | this.wmsLayerList.remove(config.typeName, config.filter) |
| | | this.reload() |
| | | } |
| | | |
| | | reload () { |
| | | const layers = this.wmsLayerList.getLayers() || '' |
| | | const filter = this.wmsLayerList.getFilters() || '' |
| | | const params = {} |
| | | params.cql_filter = filter |
| | | params.layers = layers |
| | | this.wmsLayer.setParams(params) |
| | | } |
| | | |
| | | remove (config) { |
| | | this.wmsLayerList.remove(config.typeName, config.filter) |
| | | const layers = this.wmsLayerList.getLayers() || '' |
| | | const filter = this.wmsLayerList.getFilters() || '' |
| | | const params = { layers: layers } |
| | | params.cql_filter = filter |
| | | this.wmsLayer.setParams(params) |
| | | this.wmsLayer.setParams(params, false) |
| | | } |
| | | |
| | | load () { |
| | |
| | | const params = { |
| | | format: 'image/png', // 返回的数据格式 |
| | | transparent: true, |
| | | maxZoom: 21, |
| | | BBOX: this.map.getBounds().toBBoxString() |
| | | } |
| | | if (layers) { |