Fix up bounds recalculation, previously if you removed a marker the bounds wouldn't change

This commit is contained in:
danzel
2012-09-12 17:49:48 +12:00
parent 4d51105c44
commit 5128c9c919
+3 -8
View File
@@ -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]);
}
},