For working with location-based services, such as the GPS and compass, there are a few features built into Aquro.
The following Visual Coding blocks can be used when working with location services:
Device.Geo.GetLocation
Gets the location of the device by using the location services available on the device.
Parameters:
None
Return values:
latitude (Value) - Current latitude location
longitude (Value) - Current longitude location
altitude (Value) - Current altitude over the sea (in meters)
accuracy (Value) - Position accuracy (in meters)
altitudeAccuracy (Value) - Altitude accuracy (in meters)
heading (Value) - Current direction of travel (number of degrees counter clockwise from the true north)
speed (Value) - Current ground speed (in meters / s)
timestamp (Value) - Timestamp from when the location was captured
Error (Value) - Error if something went wrong
Outlets:
GotLocation - Called when a location was found
Error - Called if something went wrong
Device.Compass.GetHeading
Get the orientation of the device
Parameters:
None
Return values:
Heading (Value) - Current latitude location
TrueHeading (Value) - Current longitude location
ErrorMessage (Value) - Error if something went wrong
Outlets:
Success- Called when the heading was found
Failure - Called if something went wrong
Device.Compass.WatchStart to monitor the compass headingParameters:
Intervall (Value) - How often the compass direction should be updated (in ms)
Return values:
Heading (Value) - Current latitude location
TrueHeading (Value) - Current longitude location
ErrorMessage (Value) - Error if something went wrong
Outlets:
Success- Called when the watch have been started
Failure - Called if something went wrong
Tick - Called everytime the compass heading is reported
Device.Compass.Stop
Stop monitoring the compass heading
Parameters:
None
Return values:
ErrorMessage (Value) - Error if something went wrong
Outlets:
Success- Called when the watch have been started
Failure - Called if something went wrong
You can always use your own custom JavaScript code to work with the GPS or with the compass.
For GPS features Aquro is using the cordova-plugin-geolocation.
More info: https://github.com/apache/cordova-plugin-geolocation
For compass features Aquro is using the cordova-plugin-device-orientation plugin
More info: https://github.com/apache/cordova-plugin-device-orientation