-
Notifications
You must be signed in to change notification settings - Fork 4
GPS
Jeff Olajos edited this page Oct 1, 2024
·
30 revisions
<GPS/> : DataSource
The GPS Datasource returns the location services data on the device that can be bound to.
- Only works on mobile platforms with location services enabled.
- Accuracy of the reading depends on the device and users settings.
- Availability of properties depends on the device and user settings.
| Name | Type | Default | Description | Req |
|---|---|---|---|---|
| id | string | null | The id of the widget used for databinding. | |
| enabled | bool | true | If the datasource is enabled. | |
| onsuccess | string/Event | null | The string of events the broker will execute upon a successful query. | |
| onfail | string/Event | null | The string of events the broker will execute upon a failed query. | |
| autoexecute | bool | true | If the gps will be started automatically when the template is first opened |
| Name | Type | Description |
|---|---|---|
| latitude | double | The gps point latitude |
| longitude | double | The gps point longitude |
| accuracy | double | The gps point latitude/longitude accuracy |
| altitude | double | The gps point altitude |
| speed | double | The gps point speed |
| speedaccuracy | double | The gps point speed accuracy |
| heading | double | The gps point heading |
| epoch | int | The gps point unix time (epoch) |
| user | string | The User who is signed in during |
| username | string | The User's username signed in |
| Name | Type | Default | Description | Req |
|---|---|---|---|---|
| data | List[Data Point] |
Addressable using DOTNOTATION. Example: <id>.data.latitude |
||
| queueType | string | replace |
replace, lifo, fifo, append, prepend. Defines the data aggregation strategy for data returned from initial and subsequent calls. replace (default) replaces all data after each subsequent call. lifo (last in first out), fifo (first in first out), append and prepend are all used in conjunction with the maxrecords attribute |
|
| maxrecords | int | 10000 | The maximum size data can grow to. This works in concert with type
|
|
| root | string | The root tag that defines the repeatable items in data. This can be a nested field. If not specified, the list is segmented by the first repeatable element found in the data set |
||
| ttl | int(s,m,h) | 0s |
Time to Live caches data in the local persistent HIVE database for the period specified. This saves requerying data that changes infrequently |
|
| rowcount | int | 0 | The number of records in data
|
| Name | Type | Description |
|---|---|---|
| clear() | Clears data. Invoked in any EVENT string using <id>.clear() |
|
| add(jsonOrXml, index) | string, int | Deserializes the jsonOrXml string and adds it to the end of data or at position index if specified. Invoked in any EVENT string using <id>.add(jsonOrXml, index) |
| remove(index) | int | Removes the last item from data or from position index if specified. Invoked in any EVENT string using <id>.remove(index) |
| reverse() | Reverses data. Invoked in any EVENT string using <id>.reverse() |
| Name | Type | Description |
|---|---|---|
| start() | Starts the gps. Invoked in any EVENT string using <id>.start() |
|
| stop() | Stops the gps. Invoked in any EVENT string using <id>.stop() |
<FML title="MAP (example1)" linkable="true">
<INCLUDE url="assets/templates/examples/header.xml"/>
<INCLUDE url="assets/templates/examples/footer.xml"/>
<GPS id="gps" />
<MAP id="MAP-1" zoom="5" latitude="{gps.data.latitude}" longitude="{gps.data.longitude}">
<LAYER url="https://tile.openstreetmap.org/{z}/{x}/{y}.png" />
<LAYER url="https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}@2x.jpg90?access_token=pk.eyJ1IjoiYXBwZGFkZHkiLCJhIjoiY2xibzR0aDNmMHh4cTNxbGI2N2o4a2k4MyJ9.riZsjgk7CLABuqelqyV6fg" />
<MARKER data="gps" latitude="{data.latitude}" longitude="{data.longitude}">
<ICON icon="gps_fixed" color="yellow"/>
</MARKER>
</MAP>
<BOX expand="false" color="blur" width="100%">
<PAD all="10">
<TEXT value="gps.data - **lat: {gps.data.latitude} long: {gps.data.longitude}**" color="white"/>
</PAD>
</BOX>
</FML>An example showing how to access the GPS data and its bindables.
Framework Markup Language is an open source programming language created by AppDaddy Software Solutions Inc. FML and is licensed under a fair source license agreement and is maintained by a community of developers.
- Quick Start
- Widget Structure
- Layout Basics
- Config
- Navigation
- Authentication
- Server Configuration
- Offline Use
- Resource Guides
-
<FML/>
- <BOX/>
- <CHART/>
- <COLUMN/>
- <DRAWER/>
- <FOOTER/>
- <FORM/>
- <GRID/>
- <HEADER/>
- <LIST/>
- <MAP/>
- <WINDOW/>
- <PAGER/>
- <ROW/>
- <SCROLLER/>
- <SPLITVIEW/>
- <STACK/>
- <TABLE/>
- <TABVIEW/>
- <TREEVIEW/>
- <WEBVIEW/>
Important Concepts