GCBGutenberg
Control Blocks
Buy

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

OptionTypeDefaultDescription
helpTextstringOne-line description shown below the control.

Gotchas

  • Requires an API key exposed via window.gcbLite.googleMaps.apiKey. Set it server-side using the gcb_google_maps_api_key filter.
  • Without an API key the control still works — but lat/lng will be null and there is no map preview.
  • Default zoom is 14 if not present on the saved value.

Example

JSON
{ "id": "ctrl_location",
  "type": "google-map",
  "label": "Office location",
  "attributeKey": "location",
  "parentPanelId": "panel" }

Every field also takes the keys common to all fields.

Built from GCB Lite 0.4.0 (ce232d4). Source: schemas/controls/google-map.md.

Copyright © 2026 Runchain. WordPress is a trademark of the WordPress Foundation.