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

Returns the closest storey to the provided elevation from the first loaded model.

## Example

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

## Usage

```javascript
const elevation = 1.0;
const buildingId = "building-1";

const storey = viewer2d.getStoreyByElevation(elevation, buildingId);
```

## Parameters

### elevation

Elevation in meters.

| **Type** | **Required** |
| -------- | ------------ |
| Number   | Yes          |

### buildingId

Limit to a specific building.

| **Type** | **Required** |
| -------- | ------------ |
| String   | No           |

## Return Value

The storey, null if no storey found.

| **Type**                               |
| -------------------------------------- |
| [Storey](docId\:aHKrYEVRXewGgDDVv9pWM) |

### Example

```javascript
{
  id: "398045672938",
  buildingId: "0.rp9o2k5sjl",
  guid: "3eM8WbY_55KK3TDWs3wwJP",
  name: "First Floor",
  modelId: "0.vo5tl2lrto",
  elevation: 1.0,
};
```

