Skip to content

Commit

Permalink
Update view.mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-leech committed Nov 20, 2023
1 parent 3c04e78 commit 0096b03
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ui/layers/view.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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')

Expand Down

0 comments on commit 0096b03

Please sign in to comment.