-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specific marker's tooltip appears when clicking outside the map #9150
Comments
Here's an example of the GeoJSON file, in case that helps: {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"id": 2118,
"imo": 9041057,
"name": "GOTICA",
"date": "2023-10-25",
"recent": true,
"url": "https://sentinelshare.page.link/NJRV"
},
"geometry": {
"type": "Point",
"coordinates": [
"32.7548",
"32.66741"
]
},
"id": 2118
},
{
"type": "Feature",
"properties": {
"id": 3603,
"imo": 9173745,
"name": "CHLOE",
"date": "2023-10-25",
"recent": true,
"url": "https://sentinelshare.page.link/9EVi"
},
"geometry": {
"type": "Point",
"coordinates": [
"56.37091",
"26.94014"
]
},
"id": 3603
},
[...hundreds more just like the ones above...]
]
} |
Also, it seems to work as intended if I use |
I just downgraded Leaflet to v1.9.3, and it now works as intended, so this seems to be something that was introduced in 1.9.4. |
@BrekiTomasson would it be possible for you the create a demo? For example on www.leafletjs.com/edit.html |
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: