[39:21] static (extern: com.aussom.aussomscript.AGeo) extends: object
The Geo class provides access to the browser's Geolocation API. All methods require the user to grant location permission. The page must be served over HTTPS or localhost for any of these methods to function. Position maps returned by getCurrentPosition and the watchPosition callback contain the following keys: latitude double Decimal degrees north/south. longitude double Decimal degrees east/west. accuracy double Accuracy of lat/lon in meters. altitude double Meters above sea level, or 0 if unavailable. altitudeAccuracy double Accuracy of altitude in meters, or 0 if unavailable. heading double Degrees clockwise from north, or 0 if unavailable. speed double Meters per second, or 0 if unavailable. timestamp double Milliseconds since the Unix epoch.
getCurrentPosition (callback OnSuccess, callback OnError = null)
Requests the device's current position. OnSuccess is called with a position map (see class description for keys) on success. OnError is called with an error map containing "code" (int) and "message" (string) on failure. Both callbacks are optional (pass null to ignore).
OnSuccess is a callback invoked with a position map on success.OnError is an optional callback invoked with an error map on failure.watchPosition (callback OnPosition, callback OnError = null)
Registers a continuous position watch. The OnPosition callback is invoked with a position map each time the device location changes. The optional OnError callback receives an error map with keys "code" (int) and "message" (string) if the watch encounters an error.
OnPosition is a callback invoked with a position map on each update.OnError is an optional callback invoked with an error map on failure.An int watch ID. Pass this to clearWatch() to stop watching.clearWatch (int WatchId)
Cancels an active watchPosition listener.
WatchId is the int watch ID returned by watchPosition().this object