From 80e2496045e0aff445777801e6f57d6f3d378ea4 Mon Sep 17 00:00:00 2001 From: danzel Date: Tue, 25 Jun 2013 09:03:53 +1200 Subject: [PATCH] Don't try extend bounds by an invalid bounds, doesn't work on leaflet versions earlier than Leaflet/Leafet@ef17f99708537e1fd8dfd525ea741e80202187d5, to be removed when 0.6 is released. --- src/MarkerClusterGroup.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index 17b24ad16..80b06528b 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -278,7 +278,11 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ } } - bounds.extend(this._nonPointGroup.getBounds()); + //TODO: Can remove this isValid test when leaflet 0.6 is released + var nonPointBounds = this._nonPointGroup.getBounds(); + if (nonPointBounds.isValid()) { + bounds.extend(nonPointBounds); + } return bounds; },