diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js index 904e45576..fe5fad396 100644 --- a/src/MarkerCluster.js +++ b/src/MarkerCluster.js @@ -316,18 +316,13 @@ L.MarkerCluster = L.Marker.extend({ i; this._bounds = new L.LatLngBounds(); + delete this._wLatLng; for (i = markers.length - 1; i >= 0; i--) { - this._bounds.extend(markers[i].getLatLng()); + this._expandBounds(markers[i]); } for (i = childClusters.length - 1; i >= 0; i--) { - this._bounds.extend(childClusters[i]._bounds); - } - - if (this._childCount === 0) { - delete this._latlng; - } else { - this.setLatLng(this._wLatLng); + this._expandBounds(childClusters[i]); } },