Why does clicking a Leaflet marker sometimes open the wrong marker?

39 views
Skip to first unread message

Keith Kaiser

unread,
Dec 31, 2023, 4:36:06 PM12/31/23
to Leaflet

In this https://net-control.us/map.php?NetID=10684 Leaflet map several markers (05, 13, 21) open the wrong marker when clicked. As a demonstration display this map, center the markers, zoom in once or twice, then click one of those markers.

All the markers in question open correctly if you increase the distance between them by zooming in further. I've seen this before in other Leaflet maps but have never been able to figure out why.

I've test in Safari, Chrome, Firefox, Brave and a few others the issues is prevalent in all of them. While there may be some other issues with this map, none show up in console.log. My only expectation is an explanation why this is happening because I'm pretty sure there is no solution based on coding but if I'm wrong please let me know.


Keith, WA0̷TJT
Author: https://net-control.us
ARRL ARES Communicator Level 2, AEC for Platte Co. MO
KCHEART Radio Operator - St. Lukes Barry Road Hospital

Mark Lawton

unread,
Dec 31, 2023, 9:12:05 PM12/31/23
to leafl...@googlegroups.com
you might want to implement spidering.  see

one world-stories as an example

--

---
You received this message because you are subscribed to the Google Groups "Leaflet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leaflet-js+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leaflet-js/74140C2C-FC65-412E-9665-5E9CD6003BA9%40gmail.com.

Keith Kaiser

unread,
Jan 1, 2024, 12:29:54 AMJan 1
to leafl...@googlegroups.com
Any chance you have a direct link to “one world-stories” ?

Keith, WA0̷TJT
Author: https://net-control.us
ARRL ARES Communicator Level 2, AEC for Platte Co. MO
KCHEART Radio Operator - St. Lukes Barry Road Hospital

Mark Lawton

unread,
Jan 1, 2024, 1:29:28 AMJan 1
to leafl...@googlegroups.com
Here u go
The code is pretty simple and you can see it all in one file

Keith Kaiser

unread,
Jan 1, 2024, 9:42:22 AMJan 1
to leafl...@googlegroups.com
Thanks Mark.

Keith, WA0̷TJT
Author: https://net-control.us
ARRL ARES Communicator Level 2, AEC for Platte Co. MO
KCHEART Radio Operator - St. Lukes Barry Road Hospital
On Jan 1, 2024, at 12:29 AM, Mark Lawton <markstev...@gmail.com> wrote:

Here u go
The code is pretty simple and you can see it all in one file

Keith Kaiser

unread,
Jan 1, 2024, 1:15:11 PMJan 1
to leafl...@googlegroups.com
Thanks for showing me this but it doesn’t really apply to my issue. The correct response is available the only thing preventing it is… well that’s the question isnt it? The two or three sometimes markers are not so close as to look like one, they are far enough apart that at almost any resolution they should be individuals. 

Thoughts?

Keith, WA0̷TJT
Author: https://net-control.us
ARRL ARES Communicator Level 2, AEC for Platte Co. MO
KCHEART Radio Operator - St. Lukes Barry Road Hospital
On Jan 1, 2024, at 12:29 AM, Mark Lawton <markstev...@gmail.com> wrote:

Here u go
The code is pretty simple and you can see it all in one file

Mark Lawton

unread,
Jan 1, 2024, 1:18:43 PMJan 1
to leafl...@googlegroups.com
hmmm.  not really sure.  i seem to remember some setting in leaflet that manages the resolution of markers.  that is, how far apart they need to be to be distinguished.  or, maybe it was a setting within the spidering plug-in.

sorry, that i don’t have any other suggestions.  if i think of something, i will let you know.



Keith Kaiser

unread,
Jan 1, 2024, 4:12:39 PMJan 1
to Leaflet
You’ve given me something to look for that I didn’t think of, a setting in LeafletJS. Thank you

Keith, WA0̷TJT
Author: https://net-control.us
ARRL ARES Communicator Level 2, AEC for Platte Co. MO
KCHEART Radio Operator - St. Lukes Barry Road Hospital
Reply all
Reply to author
Forward
0 new messages