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');