From 828bb3e2d6f31cf8cea4eb801de8dc1a54f28cff Mon Sep 17 00:00:00 2001 From: danzel Date: Tue, 2 Apr 2013 09:27:39 +1300 Subject: [PATCH] Fix not firing animationEnd when we have only one marker in the markerClusterGroup. Fixes #146 --- src/MarkerClusterGroup.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index b7c3d969a..288845779 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -842,13 +842,11 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? { //If we were in a cluster animation at the time then the opacity and position of our child could be wrong now, so fix it m.setLatLng(m.getLatLng()); m.setOpacity(1); - - return; + } else { + cluster._recursively(bounds, newZoomLevel, 0, function(c) { + c._recursivelyRemoveChildrenFromMap(bounds, previousZoomLevel + 1); + }); } - - cluster._recursively(bounds, newZoomLevel, 0, function (c) { - c._recursivelyRemoveChildrenFromMap(bounds, previousZoomLevel + 1); - }); me._animationEnd(); }, 200); },