This library provides information about the location of
the device.
Record
GeoPosition indicates the geolocation data.
- latitude float
- Latitude in decimal degrees.
- longitude float
- Longitude in decimal degrees.
- altitude float?
- Height of the position in meters above the ellipsoid.
- accuracy float?
- Accuracy level of the latitude and longitude coordinates in meters.
- altitudeAccuracy float?
- Accuracy level of the altitude coordinate in meters.
- heading float?
- Direction of travel, specified in degrees counting clockwise relative
to the true north.
- speed float?
- Current® ground speed
of the device, specified in meters per second.
- g_timestamp timestamp
- The timestamp when the location data is censored.
GeolocationOption is the option for watching geolocation.
- enableHighAccuracy boolean?
- Enables high-accuracy measurements for Boolean values.
- timeout int?
- The maximum length of time (milliseconds) that is allowed before
the callback is invoked.
- maximumAge int?
- Accepts a cached position whose age is no greater than the specified
time in milliseconds.
- Functions
- getCurrentPosition(onSuccess GeolocationSuccess in, onError CordovaErrorHandler
in, options GeolocationOption? in)
- Gets the current geolocation and returns to the onSuccess callback
function.
- onSuccess
- The success callback. GeolocationSuccess,
with the location data passed in.
- eventHandler
- This is a callback function when the event is fired, with the
CordovaEvent object passed in.
delegate GeolocationSuccess(position GeoPosition in) end
- onError
- The error callback function.
- options
- The options for getting the location.
- watchPosition(onSuccess GeolocationSuccess in, onError CordovaErrorHandler
in, options GeolocationOption? in) returns(String)
- Retrieves the location of the device at a regular interval and
execute the onSuccess callback function each time. It returns the
watch ID which can be used to clear the watch.
- onSuccess
- The success callback.
- onError
- The error callback function.
- options
- The options for getting the location.
- clearWatch(watchID String in)
- Stops watching location.
- watchID
- The watch ID of the watch that is stopped.