Replies: 5 comments 1 reply
-
Hey, that sounds like a nice project. Some of the things you want to achieve are quite difficult using only Python, especially if you also allow the user to zoom in and zoom out. So to answer your questions
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the response - I've taken a look at the solutions for 2, 3, and 4 - The direction and offset has been quite useful to help reduce overlap between the tooltip and icon. As for the opacity, it seems to affect the entire tooltip (including the text) meaning an opacity of 0.0 is unfortunately identical to having no tooltip in the first place (this is also visible in the image). This is probably as close as I can get to a solution and it already functions quite nicely now, although I do have one more question: As the cherry on top of this project, do you know of any ways I could allow Realtime to call the aforementioned function for its data rather than using a url? Regardless, thanks for the help. ![]() |
Beta Was this translation helpful? Give feedback.
-
If opacity does not do what you want, you might also try looking at css styling for the tooltip. I found an example online here: https://gist.github.com/Gordonei/6f40b6d15e1a00fce8281f5e3165ece6. |
Beta Was this translation helpful? Give feedback.
-
As for your Realtime question, it is not possible for Realtime to call a python function. There are three options I can think of for your use case:
In all three cases you need to introduce new technology (Flask, Streamlit or javascript). My guess is that option 2 is easiest to learn if you have no prior knowledge of any of the three. |
Beta Was this translation helpful? Give feedback.
-
I will take your advice and look into these alternatives, thank you for the help! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to do a fun personal project using Folium (for the first time) where I scrape flight radar data and plot it on a map (example screenshot shown below). So far all seems good, but a glaring issue which you can see on the map attached is the tooltips for each marker will often overlap each other or cover other important elements.

I have 4 questions:
Firstly, is there any way to enable some kind of overlap-avoidance feature (if this even exists!) to clean up this mess - Ideally if 2 tooltips would otherwise overlap ontop of each other it would push one left and one right (or something to that effect) so they don't overlap anymore.
Secondly (and mostly unrelated) is there any way I could remove the tooltip's white bubble entirely? I was thinking it might look nicer if I simply had white text over a black background with no bubble behind it, but I couldn't find any information on how I could remove the tooltip bubble.
Thirdly, is there any way I can force the tooltip to never overlap with the tail I'm generating? The point of the tail here is to visually show you the heading of the aircraft so if it's covered by the tooltip it's whole purpose is defeated.
Lastly, is there any way to manually push a tooltip further away from its marker? This would be done to prevent the tooltip from overlapping with the triangular element (which is supposed to be the aircraft)
Here's a copy of all the code used in this mini-project (you may need to install this unofficial FlightRadar24 API i found online if you want to recreate this on your machine).:
Beta Was this translation helpful? Give feedback.
All reactions