for (var i = 0, marker; marker = markers[i]; i++) {
    bounds.extend(marker.getPosition());
  }