From 4ce11f3c8b4a1f4c82198f06a4f082dff243682d Mon Sep 17 00:00:00 2001 From: danzel Date: Wed, 10 Jul 2013 11:04:55 +1200 Subject: [PATCH] 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. --- src/MarkerClusterGroup.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index ac3f51d58..5a5426dd7 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -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);