The Gravity Forms Geocoder Field in Gravity Geolocation is a hidden field essential for enabling seamless communication between geolocation fields. It synchronizes location data across fields such as Address, Coordinates, Locator Button, and Google Map, ensuring accurate and dynamic updates.
The Geocoder Field provides various configuration options, including default locations, marker behavior settings, and synchronization with other geolocation fields. These options allow you to customize how location data is handled in your Gravity Forms. See Geolocation Fields Syncing for more details.
Configuring the Geocoder Field
The following options allow you to customize the Geocoder Field settings:
1. Auto Locator
Automatically retrieve the user’s current location when the form first loads.
Note: Enabling this feature overrides the default coordinates settings below.
2. Default Coordinates
Set the initial location coordinates to display when the form loads. These coordinates will trigger automatic geocoding upon page load. Leave the fields blank to prevent default geocoding.
Default Latitude: Enter the latitude for the starting location (Example: 40.712776).
Default Longitude: Enter the longitude for the starting location (Example: -74.005974).
3. Map Marker Options
Customize how the map marker behaves and appears on the map.
Default Coordinates
Set the marker’s initial position on the map when the form loads. Unlike the default coordinates option above, this setting only places the marker at the specified position without triggering geocoding or updating other geolocation fields.
Default Latitude: Set the marker’s starting latitude (Example: 40.712776).
Default Longitude: Set the marker’s starting longitude (Example: -74.005974).
Marker URL
Use a custom image for the map marker (Example: https://maps.google.com/mapfiles/ms/icons/blue.png).
Marker Info Window Content
Add content displayed in a popup info window when the marker is clicked. Leave this blank to disable the info window (Example: Hello World!).
Hide Marker on Initial Load
Hide the map marker when the form first loads. The marker will appear once geocoding occurs or users interact with geolocation fields.
Disable Marker Dragging
Prevent users from dragging the marker on the map.
Move Marker Using Map Click
Allow users to reposition the marker by clicking anywhere on the map.
Disable Address Output
Prevent updates to Address Fields when moving the marker. This is useful when the address entered does not produce the exact coordinates, and you need to refine the coordinates and adjust the marker’s placement on the map without altering the entered address.
Setting Up and Using the Geocoder Field
Follow these steps to configure and use the Geocoder Field:
Add the Field: Insert the Geocoder Field into your form via the Gravity Forms editor.
Set Default Settings: Configure the default latitude, longitude, and marker options as needed.
Link Fields: Connect geolocation fields like Address, Coordinates, and Map to the Geocoder Field.
Customize Behavior: Adjust marker visibility, dragging, and click interactions.
Test the Form: Preview and test the form to verify geolocation synchronization and functionality.