From 0096b03659a78f328a87526eab34d15e266d5c12 Mon Sep 17 00:00:00 2001 From: Simon Leech Date: Mon, 20 Nov 2023 10:08:09 +0000 Subject: [PATCH] Update view.mjs --- lib/ui/layers/view.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ui/layers/view.mjs b/lib/ui/layers/view.mjs index 701c44fa0c..ea799fff96 100644 --- a/lib/ui/layers/view.mjs +++ b/lib/ui/layers/view.mjs @@ -117,6 +117,7 @@ export default (layer) => { // Add an event listener to the magnifying glass icon to show the zoom level button when clicked zoomButton.addEventListener('click', () => { + // Zoom to the extent of the layer if table provided. if (layer.tableCurrent() !== null) { layer.zoomToExtent(); @@ -142,6 +143,8 @@ export default (layer) => { if (layer.tableCurrent() === null) { + // The layer should be set to display false, as it is not available at the current zoom level. + layer.display = false; // Collapse drawer and disable layer.view. layer.view.querySelector('[data-id=layer-drawer]').classList.remove('expanded')