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

Zoom to all elements on a map #4

Open
shaneonabike opened this issue Feb 2, 2024 · 1 comment
Open

Zoom to all elements on a map #4

shaneonabike opened this issue Feb 2, 2024 · 1 comment

Comments

@shaneonabike
Copy link

Hi there,

I thought it could be an interesting feature to have the option to add the array of items being put on the map be collected, and then do a fitBounds based on those data points.

I came across this example on Leaflet JS https://stackoverflow.com/questions/16845614/zoom-to-fit-all-markers-in-mapbox-or-leaflet

@shaneonabike
Copy link
Author

Actually, after looking further at your code I was wondering even if you could guide me on how to obtain access to the layer that you are creating? I think that if I had that variable I could probably grab the bounds and then zoom accordingly using fitBounds.

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