capture-coordinates (legacy docs)

These capture-coordinates docs are out of date

New functionality and features were added to capture-coordinates in version 4.82.0 of the JourneyApps Runtime. Please refer to the latest docs here.

"Foreground" Capturing

The following example shows how GPS location capturing can be performed in the "foreground" i.e. the user sees a map showing how their GPS location is captured.

<var name="location" type="location" />

<capture-coordinates bind="location" label="GPS Location" />

"Background" Capturing

Using the show-if configuration option, it is also possible to capture a GPS location in the background (i.e. the map pictured in the screenshot above is not shown)

<var name="location" type="location" />

<capture-coordinates bind="location" label="GPS Location" show-if="false" />

Configuration

OptionRequiredDetails

bind

required

Variable/field in which to store the GPS location captured. Must be a variable or field of type location.

label

required

Text to display above the component. It can be a format string to make the text dynamic. If not specified, defaults to the value of the field specified in bind. To have no label, specify label="".

required

optional

true if this field must have a value before proceeding to another view. Defaults to false.

show-if

optional

Controls whether the component is hidden or shown. The argument specified to show-if can only be false (this only applies to the GPS component).

hide-if

optional

The opposite of show-if (see above). The argument specified to hide-if can only be true (this only applies to the GPS component).

Accessing Coordinates, Accuracy, etc. from JavaScript/TypeScript

JourneyApps supports accessing GPS latitude, longitude and accuracy information in the location field or variable that you're storing the captured GPS location. Refer to the GPS Capturing section for more information."Foreground" Capturing

The following example shows how GPS location capturing can be performed in the "foreground" i.e. the user sees a map showing how their GPS location is captured.

<var name="location" type="location" />

<capture-coordinates bind="location" label="GPS Location" />

"Background" Capturing

Using the show-if configuration option, it is also possible to capture a GPS location in the background (i.e. the map pictured in the screenshot above is not shown)

<var name="location" type="location" />

<capture-coordinates bind="location" label="GPS Location" show-if="false" />

Configuration

OptionRequiredDetails

bind

required

Variable/field in which to store the GPS location captured. Must be a variable or field of type location. (see field for more details)

label

required

Text to display above the component. It can be a XML String Formatting to make the text dynamic. If not specified, defaults to the value of the field specified in bind. To have no label, specify label="".

required

optional

true if this field must have a value before proceeding to another view. Defaults to false.

show-if

optional

Controls whether the component is hidden or shown. The argument specified to show-if can only be false (this only applies to the GPS component). Refer to the section Show/Hide Components for more details.

hide-if

optional

The opposite of show-if (see above). The argument specified to hide-if can only be true (this only applies to the GPS component).

Accessing Coordinates, Accuracy, etc. from JavaScript/TypeScript

JourneyApps supports accessing GPS latitude, longitude and accuracy information in the location field or variable that you're storing the captured GPS location. Refer to the GPS Capturing section for more information.

Last updated