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

Fit enabled overlays #1693

Merged
merged 5 commits into from
Jan 10, 2023
Merged

Conversation

Conengmo
Copy link
Member

@Conengmo Conengmo commented Jan 7, 2023

I took #1317 and revived the change. Closes #1313. Personally, I think this is a nice feature to have.

Add a class that automatically fits the bounds to the enabled overlays. Include some options to customize it. I opted to not enable the fitting when removing an overlay, that seemed more natural to me.

Example notebook that demonstrates the behavior (and functions as automated test) here: https://nbviewer.org/github/Conengmo/folium/blob/zoom-selected/examples/FitOverlays.ipynb

Copy link
Member

@ocefpaf ocefpaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Works like a charm.

@Conengmo
Copy link
Member Author

Thanks for the review! Appreciate it.

@Conengmo Conengmo merged commit e907a3c into python-visualization:main Jan 10, 2023
@Conengmo Conengmo deleted the zoom-selected branch January 10, 2023 12:07
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

Successfully merging this pull request may close these issues.

Possible to change bounds of map based on what is selected by LayerControl
2 participants