GeolocationPlugin

clearWatch

clearWatch(options: { id: string }): Promise<void>
Clear a given watch
options { id: string }
Returns: Promise<void>

getCurrentPosition

getCurrentPosition(options?: GeolocationOptions): Promise<GeolocationPosition>
Get the current GPS location of the device
options GeolocationOptions
Returns: Promise<GeolocationPosition>

watchPosition

watchPosition(options: GeolocationOptions, callback: GeolocationWatchCallback): CallbackID
Set up a watch for location changes. Note that watching for location changes can consume a large amount of energy. Be smart about listening only when you need to.
options GeolocationOptions
callback GeolocationWatchCallback
Returns: CallbackID

addListener

addListener(eventName: string, listenerFunc: Function): PluginListenerHandle
eventName string
listenerFunc Function
Returns: PluginListenerHandle

Interfaces Used

GeolocationOptions

interface GeolocationOptions {
enableHighAccuracy ?: boolean;
maximumAge ?: number;
// Whether your app needs altitude data or not. This can impact the sensor the device uses, increasing energy consumption. Note: altitude information may not be available even when passing true here. Similarly, altitude data maybe be returned even if this value is false, in the case where doing so requires no increased energy consumption.
requireAltitude ?: boolean;
timeout ?: number;
}

GeolocationPosition

interface GeolocationPosition {
// The GPS coordinates along with the accuracy of the data
coords : any;
// Creation timestamp for coords
timestamp : number;
}

GeolocationWatchCallback

type alias GeolocationWatchCallback {
}

CallbackID

type alias CallbackID {
}