Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Zoom to ... buttons for Bookmarks and Drawtools #743

Open
nexushoratio opened this issue Jun 23, 2024 · 0 comments
Open

FR: Zoom to ... buttons for Bookmarks and Drawtools #743

nexushoratio opened this issue Jun 23, 2024 · 0 comments

Comments

@nexushoratio
Copy link
Contributor

nexushoratio commented Jun 23, 2024

There have been times when I've wanted to just click a button and zoom around to a boundary including all of the current bookmarks or drawings.

It might be something as simple as:

const bounds = window.plugin.drawTools.drawnItems.getBounds();
if (bounds.isValid()) {
  map.fitBounds(bounds);
}

and

const bounds = L.featureGroup(window.plugin.bookmarks.starLayerGroup.getLayers()).getBounds();
if (bounds.isValid()) {
  map.fitBounds(bounds);
}

Heck, fitBounds() may already have a validity check allowing them to simplify further, but this way would allow for feedback in an else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant