python-visualization / folium

Python Data. Leaflet.js Maps.

Home Page:https://python-visualization.github.io/folium/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Making a tooltip stay when clicked on a marker/shape

bluearrow98 opened this issue · comments

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):

  • Jupyter Notebook on VSCode
  • Python version 3.9.6
  • folium version 0.16.0
  • branca version 0.7.2

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!