Map / Geolocation
Capture a geographic location by clicking on an interactive map or using device GPS.
Overview
The Map / Geolocation field embeds an interactive map (powered by Leaflet) that lets respondents pin an exact location. They can either click directly on the map or use the Use My Location button to auto-fill their current GPS coordinates. The field stores latitude, longitude, and an optional address string.
This is an advanced field commonly used in field data collection, delivery address forms, incident reporting, and property surveys. You can configure the default map center and zoom level, and optionally restrict the selectable area to a bounding box.
Note: GPS location requires the respondent to grant browser location permission. Always inform users why you are collecting their location.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| type | string | — | The field type identifier (e.g. "text", "email"). |
| label | string | — | Human-readable label shown above the field. |
| name | string | — | Unique machine name used as the data key in submissions. |
| required | boolean | false | When true the form cannot be submitted without a value. |
| placeholder | string | undefined | Ghost text shown inside the input when empty. |
| defaultValue | any | undefined | Pre-filled value when the form loads. |
| hidden | boolean | false | Hides the field from the rendered form (still submitted). |
| disabled | boolean | false | Renders the field as read-only and non-interactive. |
| description | string | undefined | Helper text displayed below the field label. |
| className | string | undefined | Additional CSS class applied to the field wrapper. |
| defaultCenter | [number, number] | [27.7172, 85.3240] | Default map center as [latitude, longitude]. |
| defaultZoom | number | 13 | Initial map zoom level (1–20). |
| showGpsButton | boolean | true | Show "Use My Location" button. |
| captureAddress | boolean | false | Reverse-geocode the pin to a human-readable address. |
| boundingBox | object | undefined | Restrict pin selection to { north, south, east, west } bounds. |
JSON Schema
{
"type": "map",
"label": "Incident Location",
"name": "incident_location",
"required": true,
"defaultCenter": [27.7172, 85.3240],
"defaultZoom": 12,
"showGpsButton": true,
"captureAddress": true
}Stored Value Format
{
"lat": 27.7172,
"lng": 85.3240,
"address": "Kathmandu, Bagmati Province, Nepal"
}