---
title: lookAtBoundingBox
slug: viewer-2d/methods/lookAtBoundingBox
docTags: 
createdAt: 2024-02-21T14:33:53.989Z
---

Adjusts the viewbox to the provided bounding box.

## Example

::codepen{url="https://codepen.io/Catenda/embed/rNEpeVg"}

## Usage

```javascript
const boundingBox = {
  min: { x: 0, y: 0 },
  max: { x: 10, y: 10 }
};
const options = {
  expand: 10,
  retainStoreys: true
};

viewer2d.lookAtBoundingBox(boundingBox, options);
```

## Parameters

### boundingBox

Bounding box to look at.

| **Type**                                                                    | **Required** |
| --------------------------------------------------------------------------- | ------------ |
| [Box2](docId:30eXZNfonC0xA5GLako4z) or [Box3](docId\:jFfhx6zgBAmWXgmvf_z-r) | Yes          |

### options

Options for looking at the bounding box.

| **Type** | **Required** |
| -------- | ------------ |
| Object   | No           |

**Properties**

Default value for retainStoreys is `false` when the bounding box includes a `z` coordinate and `true` when a `z` coordinate isn't included in the bounding box.

| **Name**        | **Type**                                          | **Required** | **Description**                                   |
| --------------- | ------------------------------------------------- | ------------ | ------------------------------------------------- |
| `expand`        | Number or [Vector2](docId\:HfHNmbFsrRrISUBE9WgGy) | No           | Expand the view in meters surrounding the objects |
| `retainStoreys` | Boolean                                           | No           | Keep current storeys                              |

