Skip to content

Commit

Permalink
fix: determine layer groups visibility by contained layers as well
Browse files Browse the repository at this point in the history
  • Loading branch information
ahennr committed Dec 20, 2023
1 parent 5755fc6 commit 3114eea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/parser/SHOGunApplicationUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,11 @@ class SHOGunApplicationUtil<T extends Application, S extends Layer> {
async parseFolder(el: DefaultLayerTree, layers: S[], projection?: OlProjectionLike, keepClientConfig = false) {
const layersInFolder = await this.parseNodes(el.children, layers, projection, keepClientConfig);

const visible = el.checked || layersInFolder.some(layer => layer.getVisible());

const folder = new OlLayerGroup({
layers: layersInFolder.reverse(),
visible: el.checked
visible
});

folder.set('name', el.title);
Expand Down

0 comments on commit 3114eea

Please sign in to comment.