Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jokd committed Dec 17, 2024
1 parent 3130f5d commit 1dbcd8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/controls/legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const Legend = function Legend(options = {}) {
visibleOverlaysCmp.dispatch('readOverlays');
document.getElementById(toolsCmp.getId()).classList.add('hidden');
} else {
document.getElementById(overlaysCmp.getId()).classList.remove('hidden');
const nrOverlays = overlaysCmp.getOverlays().length;
if (nrOverlays > 0) {
document.getElementById(overlaysCmp.getId()).classList.remove('hidden');
}
document.getElementById(visibleOverlaysCmp.getId()).classList.add('hidden');
document.getElementById(showAllVisibleLayersButton.getId()).classList.add('hidden');
document.getElementById(showVisibleLayersButton.getId()).classList.remove('hidden');
Expand Down
5 changes: 4 additions & 1 deletion src/controls/legend/overlays.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const Overlays = function Overlays(options) {
const nrOverlays = readOverlays().length;
if (nrOverlays === 0) {
document.getElementById(this.getId()).classList.add('hidden');
} else if (!state.visibleLayersViewActive) {
} else {
document.getElementById(this.getId()).classList.remove('hidden');
}
}
Expand Down Expand Up @@ -252,6 +252,9 @@ const Overlays = function Overlays(options) {
onChangeLayer,
slidenav,
getGroups,
getOverlays() {
return readOverlays();
},
overlaysCollapse,
onInit() {
this.addComponent(overlaysCollapse);
Expand Down

0 comments on commit 1dbcd8d

Please sign in to comment.