From e3ca8eb153739d2d40ee06df9bd55e0eb3fe089c Mon Sep 17 00:00:00 2001 From: danzel Date: Fri, 19 Oct 2012 10:07:42 +1300 Subject: [PATCH] Correct getBounds when not on the map --- src/MarkerClusterGroup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index ffeb9c00e8..7a6c262513 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -220,7 +220,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ if (this._topClusterLevel) { bounds.extend(this._topClusterLevel._bounds); } else { - for (var i = this._needsClustering.length; i >= 0; i--) { + for (var i = this._needsClustering.length - 1; i >= 0; i--) { bounds.extend(this._needsClustering[i].getLatLng()); } }