▸ Agent Skills
4 min read

@tauri-apps/plugin-geolocation

Type Aliases

Coordinates

type Coordinates: object;

Type declaration

NameTypeDescriptionDefined in
accuracynumberAccuracy level of the latitude and longitude coordinates in meters.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L24
altitudenumber | nullThe altitude the user is at, if available.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L33
altitudeAccuracynumber | nullAccuracy level of the altitude coordinate in meters, if available. Available on all iOS versions and on Android 8 and above.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L29
headingnumber | nullThe heading the user is facing, if available.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L38
latitudenumberLatitude in decimal degrees.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L16
longitudenumberLongitude in decimal degrees.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L20
speednumber | null-Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L34

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L12


PermissionStatus

type PermissionStatus: object;

Type declaration

NameTypeDescriptionDefined in
coarseLocationPermissionStatePermissions state for the coarseLoaction alias. On Android it requests/checks ACCESS_COARSE_LOCATION. On Android 12+, users can choose between Approximate location (ACCESS_COARSE_LOCATION) and Precise location (ACCESS_FINE_LOCATION). On iOS it will have the same value as the location alias.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L59
locationPermissionStatePermission state for the location alias. On Android it requests/checks both ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permissions. On iOS it requests/checks location permissions.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L49

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L41


PermissionType

type PermissionType: "location" | "coarseLocation";

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L62


Position

type Position: object;

Type declaration

NameTypeDescriptionDefined in
coordsCoordinatesThe GPD coordinates along with the accuracy of the data.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L72
timestampnumberCreation time for these coordinates.Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L68

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L64


PositionOptions

type PositionOptions: object;

Type declaration

NameTypeDescriptionDefined in
enableHighAccuracybooleanHigh accuracy mode (such as GPS, if available) Will be ignored on Android 12+ if users didn’t grant the ACCESS_FINE_LOCATION permission (coarseLocation permission).Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L80
maximumAgenumberThe maximum age in milliseconds of a possible cached position that is acceptable to return. Default: 0 Ignored on iOSSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L92
timeoutnumberThe maximum wait time in milliseconds for location updates. On Android the timeout gets ignored for getCurrentPosition. Ignored on iOSSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L86

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L75

Functions

checkPermissions()

function checkPermissions(): Promise<PermissionStatus>

Returns

Promise<PermissionStatus>

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L128


clearWatch()

function clearWatch(channelId): Promise<void>

Parameters

ParameterType
channelIdnumber

Returns

Promise<void>

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L122


getCurrentPosition()

function getCurrentPosition(options?): Promise<Position>

Parameters

ParameterType
options?PositionOptions

Returns

Promise<Position>

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L114


requestPermissions()

function requestPermissions(permissions): Promise<PermissionStatus>

Parameters

ParameterType
permissionsnull | PermissionType[]

Returns

Promise<PermissionStatus>

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L132


watchPosition()

function watchPosition(options, cb): Promise<number>

Parameters

ParameterType
optionsPositionOptions
cb(location, error?) => void

Returns

Promise<number>

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/guest-js/index.ts#L95


Support on Open CollectiveSponsor on GitHub

© 2026 Tauri Contributors. CC-BY / MIT


Last updated Oct 08, 2026