Fix getBounds when removeOutsideVisibleBounds: false is set. fixes #321

This commit is contained in:
danzel
2014-03-03 11:47:53 +13:00
parent 6e9ffc45ec
commit 34eb38f1a7
+5 -4
View File
@@ -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());