I'd like to set the vertical position of my tooltip, but have leaflet handle the horizontal, moving it left or right as needed, depending on where it is on the map. That way I could have the tooltip in, say, whichever top corner of the icon makes it visible. You can do this by putting it in the top middle of your icon, but not off to either side, as far as I can tell.
IOW, something like a "top-corner" position.
Leaflet does move the tip left or right, but it uses the offset point you set, what I'd like is to set only the absolute vertical coordinate of that point and the relative horizontal.
Part of what I want to do is have the tooltip a bit out of the way and off to the side of the icon.
Did you try adjusting the tooltip anchor or offset. https://leafletjs.com/reference-1.6.0.html#tooltip
--
---
You received this message because you are subscribed to a topic in the Google Groups "Leaflet" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/leaflet-js/3rsegLYIJH4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to leaflet-js+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leaflet-js/3a5ec212-9f83-4522-a556-4b0ae1aeb729%40googlegroups.com.
I was thinking you could calculate where you want the tooltip to open and use the openTooltip function, but thats probably the worst case solution.Are you using a custom icon? Did you try the tooltipAnchor property? Can you make an example fiddle, plunker, or a picture showing what you are trying to do?