This is an archive. | |
See the new ClickWiki at https://clickwiki.github.io. This version is just an archive for the purposes of migrating content to the new structure. |
Location object
Author | |
Status | Released |
Release Date | Unknown |
Available for | |
Supported Runtimes | |
License | Free |
Download | |
---|---|
Includes Examples | No |
Includes Help Files | Yes |
Links | Included by default. |
The Location object allows you to retrieve the position of the device from the integrated GPS sensor. You can recover the latitude, longitude, altitude and other data from this object. Please note that the GPS device in any phone drains a lot of power. This is why you should restrain its use to crucial parts of your application. The GPS circuits are turned on at the beginning of a frame that includes the Location object, and turned off when the frame exits.
Contents
Properties
Accuracy
This property allows you to set the precision factor of the GPS device. It can have several values:
- Best accuracy
- Nearest ten meters
- Hundred meter
- Kilometer
- Three kilometers
Distance
This property sets the minimal distance at which the device reports a new measure. You should keep this value to a reasonable amount to avoid multiple reports in short periods of time.
Conditions
Location services enabled
This condition returns true if the device on which the application runs has GPS services enabled.
A new location is available
This condition returns true as soon as the integrated GPS has returned a new location. Once you have this condition, you can get the values from the expressions of the location object.
Actions
Set distance filter
This action has the same effect than the distance property of the object. It allows you to set the minimal distance at which the object will return a new location.
Set accuracy
This action has the same effect than the property. It allows you to set the accuracy of the device. It accepts a number from 0 to 4:
- 0 - Best accuracy
- 1 - Nearest ten meters
- 2 - Hundred meters
- 3 - Kilometer
- 4 - Three kilometers
Expressions
Coordinates
Latitude
Latitude( "Location object" )
Returns the current latitude of the device in the form of a floating point number.
Longitude
Longitude( "Location object" )
Returns the current longitude of the device in the form of a floating point number.
Altitude
Altitude( "Location object" )
Returns the current altitude of the device in meters above the sea level.
Other values
Course
Course( "Location object" )
This expression is only valid after the second measure of position. It returns the distance between the previous measure and the current measure, in meters.
Speed
Speed( "Location object" )
This expression is only valid after the second measure of position. It returns the speed of travel between the previous measure and the current measure, in meters per seconds.
Time since last update
TimeLast( "Location object" )
Returns, in milliseconds, the time elapsed since the previous update of the GPS position.
Distance filter
DistFilter( "Location object" )
Returns the current distance filter value.
Accuracy
Accuracy( "Location object" )
Returns the current accuracy value