Google Maps and Yandex Maps for the map_address field type. PRO feature.
Configuration
update_option( 'formforge_settings', [
'map_provider' => 'google', // 'google' or 'yandex'
'map_api_key' => 'AIzaSy...', // legacy active-provider mirror
'map_google_api_key' => 'AIzaSy...',
'map_yandex_js_api_key' => '',
'map_yandex_geocoder_key' => '', // optional, Yandex typed-address proxy
'map_yandex_suggest_key' => '', // optional, Yandex live suggestions only
] );The Settings UI is provider-aware and no longer shares the primary key between providers. Google mode shows map_google_api_key as Google Maps API Key and hides all Yandex fields. Yandex mode shows map_yandex_js_api_key as Yandex JS API Key plus map_yandex_geocoder_key and map_yandex_suggest_key. Hidden provider-specific values are posted and preserved when switching providers, so a Google key cannot overwrite the Yandex JS key or vice versa. map_api_key remains as a legacy active-provider mirror for older installs and integrations that still read that option.
For Yandex, map_yandex_js_api_key loads the JavaScript API and renders the map, falling back to legacy map_api_key only when the split key is missing. map_yandex_geocoder_key enables a WordPress-side Geocoder proxy for typed address-to-coordinates lookup, using Yandex’s https://geocode-maps.yandex.ru/v1 endpoint with apikey, geocode, format=json, and results=1. When this key is present, the frontend resolves typed addresses through the proxy before submit instead of relying on the JS API’s internal api-maps.../services/search/v2 request. map_yandex_suggest_key is optional and is passed to the Yandex loader as suggest_apikey for live suggestions. The Yandex input wraps SuggestView in .formforge-map-suggest-shell so the dropdown is positioned below the input without resizing the map container. Editing clears stale lat/lng/formatted values; clearing or blurring the input closes and resets SuggestView, and stale async geocode responses are ignored if the visitor has changed or cleared the field. Visible map validation waits for Enter, submit, a selected suggestion, or a failed explicit lookup.
The public proxy action is formforge_yandex_geocode. It requires the formforge_yandex_geocode nonce rendered with the form, accepts either query for forward geocoding or lat/lng for reverse geocoding, rate-limits each IP to 60 requests per minute, and returns { address, lat, lng, source: "yandex-geocoder" }.
Address Field Configuration
{
"id": "field_location",
"type": "map_address",
"label": "Delivery Address",
"required": true,
"placeholder": "Start typing an address...",
"default_lat": "40.7128",
"default_lng": "-74.0060",
"default_zoom": 13
}Parsing Location Data in PHP
$location_data = json_decode( $submission_data['field_location']['value'], true );
$lat = $location_data['lat'];
$lng = $location_data['lng'];
$address = $location_data['address'];
$formatted = $location_data['formatted'];When rendering a saved map value outside your own custom parser, use Form Forge’s display formatter instead of echoing the stored JSON:
$readable = FORMFORGE_Value_Formatter::text( $submission_data['field_location']['value'] );This produces readable address and coordinate lines for admin views, notifications, integrations, CSV exports, and PDF exports while keeping the stored value structured for code.
Server-side validation requires a real resolved location for map_address fields. If the visitor typed an address but no numeric lat/lng was produced by Google/Yandex autocomplete, the Yandex Geocoder proxy, Yandex JS geocoding fallback, or a map click, submission fails with a field error instead of storing unresolved text as a location.
—