Fix markers not being added on a big zoom animation. Fixes #216

If we zoomed down such that a cluster would be out of our visible bounds then any of its children would be added at its location for the animation. In this case those markers would immediately be removed as they are out of our visible bounds.
Instead we now don't animate adding markers after a zoom if they are coming from outside of our visible bounds.
This commit is contained in:
danzel
2013-07-10 11:04:55 +12:00
parent 98e76b6c66
commit 4ce11f3c8b
+4
View File
@@ -840,6 +840,10 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
markers = c._markers,
m;
if (!bounds.contains(startPos)) {
startPos = null;
}
if (c._isSingleParent() && previousZoomLevel + 1 === newZoomLevel) { //Immediately add the new child and remove us
fg.removeLayer(c);
c._recursivelyAddChildrenToMap(null, newZoomLevel, bounds);