-
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
Eventlistener 'ClusterClick' gets removed when layer is toggled through layer control #200
Comments
Is this on the latest version? |
Hi Danzel, sorry I had not noticed the new version. Just tried the old config with the new version but that now gives me a "TypeError: this._nonPointGroup.hasLayer is not a function On the point where I try to add the first marker to the MarkerClusterGroup: *the 'iconlaag' was defined as follows: iconlaag = new L.MarkerClusterGroup(); Thanks, Annet p.s.: I get the same when I remove the .addTo(iconlaag) and try to add it using iconlaag.addLayer(m). Also when I remove all custumised options from the marker m and define it as being new L.marker([lat, lon]); It breaks at the point where the marker should be added to the MarkerClusterGroup. |
Ah yeah. The current master of markercluster requires a master version of leaflet too. Try grab this slightly older one which will work with 0.5: I'll write up a test for events now to make sure this is fixed. |
Wow, thanks for reporting this one. We really didn't handle being removed from the map very well! Should be all fixed up in the master version now, you will need a version of leaflet newer than 2013-01-21 as we rely on some of the new features (Current master should be fine). |
Thanks for the quick fix! Works perfect now! :o) |
I can confirm that the issue is solved by using the master of Leaflet.markercluster and Leaflet of today July 8th 2013. Regards Ingmar |
Hi all, I have had the following issue and found a workaround, but I am wondering if this would be 'the way to go'. Here it comes:
I add a new MarkerClusterGroup layer, and on this I attach the EventListener 'clusterclick'. Works like a charm. But as soon as this layer gets toggled off/on through the LeafletJS layer control, the eventlistener is removed.
I found a workaround where I now use an eventlistener to 'layeradd' and whenever this gets fired I add the 'clusterclick' listener (again). Seems a bit redundant though. Any thoughts on the matter?
Thanks in advance!
Best wishes and by the way, thanks for this great plugin!
Annet
The text was updated successfully, but these errors were encountered: