Field type
google-map
Address autocomplete plus a draggable map marker. Needs a Google Maps JS API key — without one, it falls back to a plain address input that only fills address.
Type: google-map · Stored attribute type: object
Stored value
{ address: string, lat: number | null, lng: number | null, zoom: number }
Supports
- Places Autocomplete for address search
- Interactive map preview with draggable marker
- Graceful fallback to plain address input when no API key is configured
Config options
| Option | Type | Default | Description |
|---|---|---|---|
helpText | string | One-line description shown below the control. |
Gotchas
- Requires an API key exposed via
window.gcbLite.googleMaps.apiKey. Set it server-side using thegcb_google_maps_api_keyfilter. - Without an API key the control still works — but
lat/lngwill benulland there is no map preview. - Default zoom is 14 if not present on the saved value.
Example
{ "id": "ctrl_location",
"type": "google-map",
"label": "Office location",
"attributeKey": "location",
"parentPanelId": "panel" }Every field also takes the keys common to all fields.