Skip to content

GeolocationAPI

Types

geolocation

An object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location. See Geolocation on MDN

type geolocation = {}

Module

There are methods and helpers defined in Geolocation .

geolocationCoordinates

type geolocationCoordinates = {
accuracy: float,
latitude: float,
longitude: float,
altitude: Null.t<float>,
altitudeAccuracy: Null.t<float>,
heading: Null.t<float>,
speed: Null.t<float>,
}

Record fields

accuracy
float
latitude
float
longitude
float
altitude
Null.t< float >
altitudeAccuracy
Null.t< float >
heading
Null.t< float >
speed
Null.t< float >

Module

There are methods and helpers defined in GeolocationCoordinates .

geolocationPosition

type geolocationPosition = {
coords: geolocationCoordinates,
timestamp: int,
}

Record fields

timestamp
int

Module

There are methods and helpers defined in GeolocationPosition .

geolocationPositionError

type geolocationPositionError = {code: int, message: string}

Record fields

code
int
message
string

positionCallback

type positionCallback = geolocationPosition => unit

positionErrorCallback

type positionErrorCallback = geolocationPositionError => unit

positionOptions

type positionOptions = {
mutable enableHighAccuracy?: bool,
mutable timeout?: int,
mutable maximumAge?: int,
}

Record fields

enableHighAccuracy
option< bool >
timeout
option< int >
maximumAge
option< int >