Location Services control
The Location Services control provides location and time information based on the Global Positioning System (GPS) of mobile devices. The control uses Latitude, Longitude, Accuracy, Altitude Accuracy and Altitude to determine the location. The control can be used for example to track a device or determine the time spent at a certain location etc.
The control can be used to:
- Track a device
- Determine the time spent at a certain location
- Asynchronously retrieve details about a user's current location
- Create a View/Form .
- Drag the Location Services control onto the canvas. The control can be found in the Information section of the Controls found in the View and Form Designer.
- Configure rules to execute the Location Services methods for example:
- Configure the rules actions for example:
- Configure the rest of the properties as required.
- Run the View/Form.
- One example could be the following at runtime:
- Only Apple devices return data for Altitude or Altitude Accuracy.
- Latitude and Longitude coordinates are displayed in Signed Degrees (decimal fractions).
- When using the Location Services control along with a Content control to display a map, there may be issues using particular mapping site URLs. See the relevant troubleshooting topic for more information.
- A rule is required to be executed on the "Location Changed" event before the values of the control can be retrieved.
- The Location Services control is NOT a mapping control.
- Where no values are retrieved, 0.0 will be returned. This means no data is available and applies to Latitude, Longitude, Accuracy, Altitude accuracy and Altitude.
Rule events:
- Error - execute the rule when the timeout has expired.
- Initializing - execute the rule when the View/Form is loading
- Location Changed - execute the rule when the location is retrieved.
Control methods:
- Get location - Gets the location of the device at that exact time. The method is called asynchronously, so this method should always be used in conjunction with the Location Changed event.
- Start Watching - Fires continuously every time the device's location changes until the Stop Watching method is executed.
- Stop Watching - Stops the method from executing.
The Location Services control interacts with other controls through rules. Depending on the control properties, there are certain actions where the control surfaces. Following are a few examples:
- Set a control’s properties: The control's settable properties can be configured using this action
- Enable/Disable: The Enabled property allows for the control to be enabled or disabled through rules
The Location Services control is available in the Information section of the Controls tab found in the View and Form Designer.
Property | Description | Can be set in runtime using Rules |
---|---|---|
Detail | ||
Name | A unique identifier for the selected control. This property is required. | No |
Settings | ||
Timeout | The amount of time the application will try to pick up the location of the device. This is measured in milliseconds. | Yes, see Control Properties Actions for more information |
Enabled | A Boolean value used to establish whether the control is enabled during runtime | Yes, see Control Properties Actions for more information |
The following settings are available:
Property | Description | Can be set in runtime using Rules |
---|---|---|
Detail | ||
Name | A unique identifier for the selected control. This property is required. | No |
Settings | ||
Enabled | A Boolean value used to establish whether the control is enabled during runtime | Yes, see Control Properties Actions for more information |
Timeout | How long the application will try to pick up the location of the device. This is measured in milliseconds. | Yes, see Control Properties Actions for more information |
Location | ||
Latitude | This is the North/South coordinate. Latitude is used together with Longitude to specify the precise location of features on the surface of the Earth. Measured in degrees. | Yes, see Control Properties Actions for more information |
Longitude | This is the East/West coordinate. Longitude is used together with Latitude to specify the precise location of features on the surface of the Earth. Measured in degrees. | Yes, see Control Properties Actions for more information |
Altitude | This is a measurement of the vertical distance in metres from a given reference ellipsoid. In this case sea level. | Yes, see Control Properties Actions for more information |
Accuracy | This is the measure of the accuracy in relation to the returned Latitudinal and Longitudinal coordinates. This is measured in metres. This property along with latitude and longitude should always be returned by any device with a GPS chip. | Yes, see Control Properties Actions for more information |
Altitude Accuracy | The accuracy of distance in relation to the Altitude position, measured in metres. | Yes, see Control Properties Actions for more information |
Time Stamp | Date and time information. | Yes, see Control Properties Actions for more information |
Location Age | When set, will retrieve the location where the user was at that amount of time ago, in other words when last the location was measured. This value is measured in milliseconds. | Yes, see Control Properties Actions for more information |
Error | ||
Error Message | Contents of the message that is returned by the system. | Yes, see Control Properties Actions for more information |
Error Code | The specific error code linked to the error message. | Yes, see Control Properties Actions for more information |