diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index bde4a8b5f4..4b77fbfcdc 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -324,12 +324,13 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ //Override FeatureGroup.getBounds as it doesn't work getBounds: function () { var bounds = new L.LatLngBounds(); + if (this._topClusterLevel) { bounds.extend(this._topClusterLevel._bounds); - } else { - for (var i = this._needsClustering.length - 1; i >= 0; i--) { - bounds.extend(this._needsClustering[i].getLatLng()); - } + } + + for (var i = this._needsClustering.length - 1; i >= 0; i--) { + bounds.extend(this._needsClustering[i].getLatLng()); } bounds.extend(this._nonPointGroup.getBounds());