Description
PROBLEMS
Two bugs I've recently noticed with clustering when adding an array of markers in batches:
-
Cluster icons are generally not updated to reflect the current number. Their zoom boundaries are however.
-
Clicking a cluster at max zoom so it spiderfies and clicking elsewhere (so it unspiderfies) gives this error after a few times:
Uncaught TypeError: Cannot set property '_leaflet_pos' of undefined.
Here's the relevant stack trace for it:
L.MarkerCluster.include.L.DomUtil.TRANSITION._animationUnspiderfy leaflet.markercluster-src.js:1722
L.MarkerCluster.include.unspiderfy leaflet.markercluster-src.js:1514
L.MarkerClusterGroup.include._unspiderfy leaflet.markercluster-src.js:1836
L.MarkerClusterGroup.include._unspiderfyWrapper leaflet.markercluster-src.js:1831
DEMO
The demo is set up so that every second 100 new markers are added. Steps to reproduce each bug:
-
Just load the demo and wait a few seconds for the screen to get some clusters. You should notice that they all say 2, even though some will have more than that (which can be verified by clicking or hovering to see the zoom boundary).
-
Randomly click clusters until clicking no longer does anything, then check the console.
Activity