From c75ca724389e4835c8de05f8a70745df7c3b76fc Mon Sep 17 00:00:00 2001 From: Jonas Date: Fri, 6 Dec 2024 13:26:13 +0100 Subject: [PATCH] Update legend.js --- src/controls/legend.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/controls/legend.js b/src/controls/legend.js index 592a3de34..06e348577 100644 --- a/src/controls/legend.js +++ b/src/controls/legend.js @@ -223,7 +223,6 @@ const Legend = function Legend(options = {}) { const setVisibleLayersViewActive = function setVisibleLayersViewActive(active) { if (!visibleLayersControl) return; visibleLayersViewActive = active; - overlaysCmp.readOverlays() if (visibleLayersViewActive) { document.getElementById(overlaysCmp.getId()).classList.add('hidden'); document.getElementById(visibleOverlaysCmp.getId()).classList.remove('hidden'); @@ -233,7 +232,7 @@ const Legend = function Legend(options = {}) { document.getElementById(toolsCmp.getId()).classList.add('hidden'); } else { const nrOverlays = overlaysCmp.readOverlays().length; - if(nrOverlays > 0){ + if(nrOverlays > 0) { document.getElementById(overlaysCmp.getId()).classList.remove('hidden'); } document.getElementById(visibleOverlaysCmp.getId()).classList.add('hidden');