-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add button to enable/disable scrolling #144
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
Conversation
Nice idea. Keeping in mind that
@ocefpaf what do you think about this? |
@themiurgo I am at SciPy right now (and I really need to get back to folium!!!) I trust your judgement. Just consider making that optional to avoid braking people current layout. |
Thanks for your answers. Thanks again (and enjoy SciPy ;-)) |
@@ -52,6 +65,12 @@ | |||
|
|||
<div class="folium-map" id="{{ map_id }}" {{ size }}></div> | |||
|
|||
{% if zoom_toggler %} | |||
<img id="toggle_scroll" alt="scroll" | |||
src="https://cdnjs.cloudflare.com/ajax/libs/ionicons/1.5.2/png/512/arrow-move.png" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Thanks @BibMartin! That is a nice addition to folium. Can you update the changelog? BTW: This PR is OK. Ignore the test failure for now. (I have a PR sitting here to fix travis.) |
Done. Please tell me how I can improve contribution quality ; this is my first PR. |
I'm not sure it's a good idea to include this functionality in the Also, before merging, it would be good to include a little test, to make sure that the functionality works (and will keep working in the future). |
[This also shows the importance of implementing soon a good way to handle plugins. That way we might have a generic |
Agreed! Or we will end up like
Read my mind! @BibMartin take a look at our (horrible and monolithic) test file for examples.
This should be our number 1 priority! If only we had the time... |
I don't feel I understand well how plugins are handled yet. In my mind, we can define a plugin as an object with methods like I did an illustration (BibMartin@5238fb9 ) but put it on another branch because is seems like a dirty hack to me. As for the tests, I can implement one that creates a map with a |
Don't worry @BibMartin . We don't either 😜 @themiurgo can you take a look at BibMartin@5238fb9? Does it goes in the direction of what you were planning? |
Yes, it does. Thanks @BibMartin! Perhaps we should continue this discussion on a separate |
Ok, I have created issue #145 to host the discussion. As for this PR, I would suggest to freeze it until we know how it shall be implemented to comply with the plugins mindset. |
I agree, that's sensible. |
I close this, because it's redundant with #148. |
When embedding a leaflet chart in a webpage (in a jupyter notebook, for example), you've got a quite heavy behavior when scrolling your web page : when the charts comes under the mouse cursor, then you zoom into your map instead of scrolling down the page.
I solve this in adding a small button in the bottom left corner, that toggle the scrolling behavior.