You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It initalizes a map, then uses the leaflet-realtime library to pull in a GeoJSON file, and then uses the content of the GeoJSON to design a tooltip that it adds to each of the markers. So far so good.
However, when I click outside of a marker, anywhere on the map that isn't already covered in a marker, it automatically brings up the tooltip for a specific marker, and it's always the SECOND marker in the GeoJSON. I've checked Z-levels, I've checked that there's nothing odd with the features or properties, and nothing seems to stand out as broken. If I change the order of elements in the FeatureCollection, it still always pops up the tooltip for the SECOND marker in there.
I've stepped through the events that happen in the browser, and it seems that the marker is somehow selected by the time it gets to the update method in DivOverlay.js, but I can't tell why that particular marker (or its tooltip, more precisely) is the one being brought up.
Here's a video showing the bug in action:
Screen.Recording.2023-10-25.at.21.24.15.mov
Any help would be greatly appreciated!
Expected behavior
Clicking outside of a marker should close all tooltips and not open any new ones.
Current behavior
Clicking outside of a marker always opens a particular marker's tooltip, unless that one is currently open, in which case it closes that tooltip.
Also, it seems to work as intended if I use bindTooltip instead of bindPopup but as I have links inside the information box that pops up, that's not a viable solution for me.
@BrekiTomasson would it be possible for you the create a demo? For example on www.leafletjs.com/edit.html
And can you please test if it also happens without the leaflet-realtime plugin?
Checklist
Steps to reproduce
I've got a fairly straightforward map where the Javascript looks like this:
It initalizes a map, then uses the
leaflet-realtime
library to pull in a GeoJSON file, and then uses the content of the GeoJSON to design a tooltip that it adds to each of the markers. So far so good.However, when I click outside of a marker, anywhere on the map that isn't already covered in a marker, it automatically brings up the tooltip for a specific marker, and it's always the SECOND marker in the GeoJSON. I've checked Z-levels, I've checked that there's nothing odd with the features or properties, and nothing seems to stand out as broken. If I change the order of elements in the FeatureCollection, it still always pops up the tooltip for the SECOND marker in there.
I've stepped through the events that happen in the browser, and it seems that the marker is somehow selected by the time it gets to the update method in
DivOverlay.js
, but I can't tell why that particular marker (or its tooltip, more precisely) is the one being brought up.Here's a video showing the bug in action:
Screen.Recording.2023-10-25.at.21.24.15.mov
Any help would be greatly appreciated!
Expected behavior
Clicking outside of a marker should close all tooltips and not open any new ones.
Current behavior
Clicking outside of a marker always opens a particular marker's tooltip, unless that one is currently open, in which case it closes that tooltip.
Minimal example reproducing the issue
No response
Environment
The text was updated successfully, but these errors were encountered: