---
title: "GeolocateControlEventType | 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.

# Type Alias GeolocateControlEventType

`GeolocateControlEventType` - a mapping between the geolocate control event name and the event value. These events are used with the [GeolocateControl.on](https://docs.maptiler.com/sdk-js/api-reference/classes/GeolocateControlMLGL/#on) method.

type GeolocateControlEventType \= {  
    [error](#error): [GeolocateErrorEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/GeolocateErrorEvent/);  
    [geolocate](#geolocate): [GeolocatePositionEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/GeolocatePositionEvent/);  
    [outofmaxbounds](#outofmaxbounds): [GeolocatePositionEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/GeolocatePositionEvent/);  
    [trackuserlocationend](#trackuserlocationend): [GeolocateEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/GeolocateEvent/);  
    [trackuserlocationstart](#trackuserlocationstart): [GeolocateEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/GeolocateEvent/);  
    [userlocationfocus](#userlocationfocus): [GeolocateEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/GeolocateEvent/);  
    [userlocationlostfocus](#userlocationlostfocus): [GeolocateEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/GeolocateEvent/);  
}

##### Index

### Properties

[error](#error) [geolocate](#geolocate) [outofmaxbounds](#outofmaxbounds) [trackuserlocationend](#trackuserlocationend) [trackuserlocationstart](#trackuserlocationstart) [userlocationfocus](#userlocationfocus) [userlocationlostfocus](#userlocationlostfocus)

## Properties

### error[](#error)

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

Fired on each Geolocation API position update which returned as an error.

### geolocate[](#geolocate)

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

Fired on each Geolocation API position update which returned as success.

### outofmaxbounds[](#outofmaxbounds)

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

Fired on each Geolocation API position update which returned as success but the user position is out of map `maxBounds`.

### trackuserlocationend[](#trackuserlocationend)

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

Fired when the geolocate control changes to the background state.

### trackuserlocationstart[](#trackuserlocationstart)

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

Fired when the geolocate control changes to the active lock state.

### userlocationfocus[](#userlocationfocus)

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

Fired when the geolocate control's button is clicked in the active lock state.

### userlocationlostfocus[](#userlocationlostfocus)

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

Fired when the user changes the viewport while in the active lock state.
