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

Returns the location of the specified pixel coordinates.

## Example

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

## Usage

```javascript
const coordinates = {
  x: 100,
  y: 50
};

const coordinatesLocation = viewer2d.getLocation(coordinates);
```

## Parameters

### coordinates

Coordinates in pixels to get location.

| **Type**                                | **Required** |
| --------------------------------------- | ------------ |
| [Vector2](docId\:HfHNmbFsrRrISUBE9WgGy) | Yes          |

## Return Value

Location of the coordinates.

| **Type**                                                                           |
| ---------------------------------------------------------------------------------- |
| [Vector2](docId\:HfHNmbFsrRrISUBE9WgGy) or [Vector3](docId\:gQdK6kHl9IuzRieGxVDD0) |

