Jump to content

Component: Location ( Data)

From Flowcode Help
Author MatrixTSL
Version 1.0
Category Data


Location component

Component that provides the mobile device's physical location.


Version information

Library Version, Component Version, Date, Author, Info
1, 1.0, 23-04-26, ST, Created

Detailed description

Many mobile devices have the capability of reporting the physical location of the device (e.g. by using an internal GPS sensor).

This component allows access to this information.


Examples

Plotting geolocation data

This example regularly plots the current location of the device onto a canvas object.

GeolocationPlotter.fcweb

The web app created by this example can be viewed here: GeolocationPlotter Example


Macro reference

Cancel

Cancel
Cancels any continuous retrieval of location information. 
- VOID Return


GetPosition

GetPosition
Asks the device to return position information. The OnSuccess callback will be called with appropriate location information is successful. If unsuccessful, the OnFailure callback will provide the reason for failure. Returns false if geolocation is not supported by the browser. 
- BOOL Continuous
Set to true to continually monitor the position and receive a callback whenever the location has changed 
- BOOL Return


Property reference

Properties
OnSuccess
Called when position info is successfully found. Latitude, longitude and altitude are provided as parameters. The raw object is also provided for advanced information. 
OnFailure
Called when position info is not returned successfully 
Options
MaximumAge
Maximum age (in ms) of a possible cached position that is acceptable to return. A value of 0 means the device must always attempt to retrieve to actual current position. 
Timeout
The maximum time (in ms) that the device can take when trying to retrieve a position. 
HighAccuracy
Using High Accuracy will provide a more accurate position, but may be slower and increase power consumption. 

Component Source Code

Please click here to download the component source project: FC_Comp_Source_WEBEXP_Geolocation.fcsx

Please click here to view the component source code (Beta): FC_Comp_Source_WEBEXP_Geolocation.fcsx