(layer)
| 11 | } |
| 12 | |
| 13 | addLayer(layer) { |
| 14 | if (layer.renderSource.sourceLayer) { |
| 15 | if (!this.children) { |
| 16 | this.children = []; |
| 17 | this.type = 'group'; |
| 18 | this.renderSource = {}; |
| 19 | this.dataSource = {}; |
| 20 | this.themeSetting = {}; |
| 21 | } |
| 22 | if (layer.visible || this.visible) { |
| 23 | this.visible = true; |
| 24 | } else { |
| 25 | this.visible = false; |
| 26 | } |
| 27 | this.children.push(layer); |
| 28 | return; |
| 29 | } |
| 30 | this.renderLayers.push(...layer.renderLayers); |
| 31 | if (layer.reused) { |
| 32 | this.reused = layer.reused; |
| 33 | } |
| 34 | if (layer.layerOrder) { |
| 35 | this.layerOrder = layer.layerOrder; |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | export default SourceModel; |
no test coverage detected