Developer Documentation Library > Interview templates > UXUI built-in templates > GeoLocation template
 
GeoLocation template
This template captures the location of the interview by using the GeoLocation Web API and an optional interview public function.
You can use this template only if you use HTTPS to access the interviewing cluster, because the GeoLocation Web API is available only in secure contexts.
The respondent must allow the browser to know their location. This might require a setting or a response to a pop-up.
The GeoLocation Web API location is stored in a text question as Longitude|Latitude. The interview public function can return an address that is added to the text question as Longitude|Latitude|Address.
The location value can be displayed to the respondent or hidden.
Associated uxui_template_props
silent
Specifies whether the question is hidden. If set to true, the question is not displayed.
If you want to hide the GeoLocation question, put it on a page with other questions, and then silent to true. If the GeoLocation question is asked by itself, the page is empty.
The default value is false.
showValue
Specifies whether the text edit control is visible. This property is ignored if silent is true.
The default value is false.
addressFunction
The name of a public function used to set the additional Address part of the text value.
timeout
The maximum length of time (in milliseconds) that the device is allowed to take to return a position. The value must be a positive long value.
The default value is infinity.
enableHighAccuracy
true indicates the application wants to get the best possible result. This might make responses slower or use more power (for example, when using the GPS chip on a mobile device).
false might make responses faster and use less power, but the result might not be so accurate.
The default value is false.
Applies to
Text questions
Example
GeoLocationQ "This page gathers the location for the interview. The location is displayed."
[
uxui_template_name = "geolocation",
uxui_template_props = "{ showValue: true }"
]
text[0..256];
See
Interview templates