---
title: "GeolocatePositionEvent | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Class GeolocatePositionEvent

The event class for the geolocate control `geolocate` and `outofmaxbounds` events. Carries the [Position](https://developer.mozilla.org/en-US/docs/Web/API/GeolocationPosition) returned by the Geolocation API.

#### Hierarchy ([View Summary](https://docs.maptiler.com/sdk-js/api-reference/hierarchy/#GeolocatePositionEvent))

-   [Event](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/)
    -   GeolocatePositionEvent

##### Index

### Constructors

[constructor](#constructor)

### Properties

[coords](#coords) [target](#target) [timestamp](#timestamp) [type](#type)

## Constructors

### constructor[](#constructor)

-   new GeolocatePositionEvent(type: string, data?: object): GeolocatePositionEvent[](#constructorgeolocatepositionevent)
    
    #### Parameters
    
    -   type: string
    -   `Optional`data: object
    
    #### Returns GeolocatePositionEvent
    
    Inherited from [Event](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/).[constructor](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/#constructor)
    

## Properties

### coords[](#coords)

coords: [GeolocationCoordinates](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.GeolocationCoordinates/)

The geographic position returned by the Geolocation API.

### target[](#target)

target: [GeolocateControlMLGL](https://docs.maptiler.com/sdk-js/api-reference/classes/GeolocateControlMLGL/)

The `GeolocateControl` object that fired the event.

Overrides [Event](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/).[target](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/#target)

### timestamp[](#timestamp)

timestamp: number

The time at which the position was acquired, in milliseconds since the Unix epoch.

### type[](#type)

type: "geolocate" | "outofmaxbounds"

Overrides [Event](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/).[type](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/#type)
