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

Returns the bounding box for a list of spaces.

## Example

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

## Usage

```javascript
const spaceIds = ["space-1", "space-2"];

const boundingBox = viewer2d.getBoundingBox(spaceIds);
```

## Parameters

### spaceIds

List of space ids.

| **Type**       | **Required** |
| -------------- | ------------ |
| Array\[String] | Yes          |

## Return Value

The bounding box of the spaces.

| **Type**                             |
| ------------------------------------ |
| [Box3](docId\:jFfhx6zgBAmWXgmvf_z-r) |

### Example

```javascript
{
  max: {
    x: 100,
    y: 100,
    z: 0,
  },
  min: {
    x: 0,
    y: 0,
    z: 0,
  },
}
```

