python-visualization / folium

Python Data. Leaflet.js Maps.
https://python-visualization.github.io/folium/
MIT License
6.93k stars 2.23k forks source link

Making a tooltip stay when clicked on a marker/shape #1950

Closed bluearrow98 closed 6 months ago

bluearrow98 commented 6 months ago

Describe the bug I am not sure if this is really a bug or a feature request because I cannot figure out if this is an existing feature. Basically, the tooltip does not stay open when one clicks on it. if one would like to look at some stats in the tooltip over a folium rectangle (or any shape/ marker) and check something else with those stats in the background, then this becomes a bit annoying because now I again need to find the correct rectangle at which I viewed the tooltip.

To Reproduce The tooltip popup vanishes as soon as I move away from a folium rectangle, especially when I click on a given rectangle. So it is not fixed if one wants to see a given rectangle tooltip stay open temporarily.

Expected behavior Ideally, if one just clicks on a marker/shape and the tooltip should just stay there until I click it again (and not vanish as I move the mouse - of course, when I don't click anything, the tooltip should change as I move the mouse around the map). So something just like the permanent option, but actually temporary.

Environment (please complete the following information):

bluearrow98 commented 6 months ago

Turns out that popup is the feature that does what I actually want. So I shifted the content in my tooltip to popup, and now it does what I expect it to do. I think this is better, because I can keep minimal information in tooltip, and more important stuff goes in the popup (which stays longer when one clicks on the marker).

Anyways, thanks for creating such an amazing tool!