-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Duplicate markers #860
Comments
Weird. Check the leafletmarkercluster code and see if we read maxZoom / minZoom from map all the time, or if we cache it internally. |
@danzel Can you direct me to the relevant file that might cause this? |
Hey sorry I'm not gonna look through your code. Make a minimal reproduction. In leaflet.markercluster, look for uses of um... map.getMinZoom / getMaxZoom. |
I don't think this is the case I'm seeing on my site but the following plunker gets stuck when uncommenting the |
I have switched away from the minified version to the src version.
I have played around with my site to try and reproduce it and it doesn't seem to be related to removing or adding a layer to the map. Looking at the code the following is interesting:
but later the for loop tried the following:
So I'm guessing this method should return if parent is null? |
That error comes up every now and then. |
@danzel I can't help if you're not helping me... |
I appreciate that you want this issue resolved. I don't have time to look through your application to figure out how it is interacting with L.MCG to cause this issue however. If you can create a stand alone simplified test that reproduces this error then I can take a look. This issue is almost certainly your app interacting with L.MCG in an incorrect way, something that we don't always give good error messages for (usually due to performance concerns). If you search the github issues for I may have written this code, but that doesn't mean I need to support it, I'm doing you a favor by replying on here at all, I'm not getting paid to do this. |
I think I managed to reproduce it here: I would appreciate your help even though you are not getting paid (I'm not getting paid for this either... ;-)). |
Thanks! |
Great! I have tried some things and when using the following code instead of this.markers.eachLayer((m) => {
this.markers.removeLayer(m);
}); |
…n the map. Otherwise we'll try remove them when we are added, which breaks things. Refs #860
Added a commit, try build latest markercluster code and try that. |
Hi @HarelM, For the sake of testing, here is your Plunker updated with @danzel's latest commit: It correctly prevents the error in the provided case. |
Does this seem to fix it in your app as well? |
The workaround I wrote earlier seems to overcome the issue and the reproductions came from logging I did on my app so if the reproduction is fixed I'm guessing my app will be fixed too but since I'm using angular-cli it hard for me to test code that does not exist in npm. so I prefer a pre-release in npm if possible... |
Hi @HarelM - Can you post your workaround for this issue? Just to be clear, I am seeing just duplicate callouts per group - upon zooming in. The group + coordinates seem okay - it's just the callouts: Just reference, I'm adding layer + binding popup per group:
Thanks. |
See above, the problem I had was related to clearLayers method, so I cleared every marker individually.
|
Fix (to be released shortly) in 1.4.0 |
I'm still seeing this issue. And I know even less about why this would be happening at a code level. But the problem occurred for me when placing a comment and then zooming in/out while the comment bubble was open. For every zoom level (maybe every tile load) I was getting another pin. Still investigating a solution, but if there is an obvious one, I'd love to hear it! Thanks! |
I've moved away from leaflet, sorry... Good luck though :-) |
How to reproduce
Not entirely sure, has to do with timing so it's not straight forward.
I think the case that I'm experiencing has the following characteristics:
I'm changing the base layer of my map which adds and removes a tile layer.
While doing do I change the markers inside the cluster.
I have seen a similar stack trace when trying to add a cluster layer when there's no base layer map so the zoom is not defined or something, but I'm not sure...
Image of this issue can be seen here:
IsraelHikingMap/Site#582
I do get the following error message.
What behaviour I'm expecting and which behaviour I'm seeing
Number of element in a cluster should no grow when changing zoom level, but every time I change the zoom level more makers are added to the cluster. this only happens once I enter a "corrupted" state - meaning after an error message like the above is generated.
Minimal example reproducing the issue
Couldn't create on...
I'd be happy to help out but I'm not sure how...
Versions:
leaflet 1.2.0
leaflet.markercluster 1.2.0
The text was updated successfully, but these errors were encountered: