Skip to content

Commit

Permalink
Skip if group is exclusive
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyblasta committed Oct 12, 2022
1 parent f394b87 commit 8d000f2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/controls/legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,14 @@ const Legend = function Legend(options = {}) {
const layers = viewer.getLayers();
layers.forEach((el) => {
if (!(['none', 'background'].includes(el.get('group')))) {
el.setVisible(true);
const group = viewer.getGroups().find((item) => item.name === el.get('group'));
if (typeof group !== 'undefined') {
if (!group.exclusive) {
el.setVisible(true);
}
} else {
el.setVisible(true);
}
}
});
};
Expand Down

0 comments on commit 8d000f2

Please sign in to comment.