The Geocoder Field in Ninja Forms Geolocation plays a vital role in synchronizing geolocation fields within your form. Specifically, it manages and updates location data across key fields like Address, Coordinates, Locator Button, and Google Map. As a result, users experience precise and dynamic interactions.
Moreover, this field offers extensive configuration options, including default location settings, marker behavior, and synchronization preferences. As a result, you can customize geolocation functionalities to match your form’s needs. Learn more about geolocation synchronization in Synchronizing Geolocation Fields.
Configuring the Geocoder Field
To customize the behavior of the Geocoder Field, consider the following options:
Options available for configuring the Geocoder Field in Ninja Forms Geolocation.
2. Default Coordinates
Define the latitude and longitude for the initial location when the form is loaded. These coordinates will be used when the Geocode on Page Load option is enabled. Otherwise, they serve as the marker’s default position without triggering geocoding.
Default Latitude
Set the default latitude for the geolocation fields (Example: 40.712776).
Default Longitude
Set the default longitude for the geolocation fields (Example: -74.005974).
Geocode on Page Load
Enable geocoding for the default location when the form loads.
Option:Check to enable.
3. Map Marker Options
Customize how the map marker appears and behaves within the form.
Marker URL
Set a custom marker image URL (Example: https://maps.google.com/mapfiles/ms/icons/blue.png).
Marker Info Window Content
Define content to display when the marker is clicked. Leave blank to disable the info window (Example: Hello World!).
Hide Marker on Initial Load
Prevent the marker from appearing when the form first loads. The marker will appear after geocoding or user interaction.
Disable Marker Dragging
Prevent users from dragging the marker while still allowing updates via other geolocation fields.
Move Marker Using Map Click
Allow users to reposition the marker by clicking on the map.
Disable Address Output
Prevent updates to Address Fields when moving the marker, useful for adjusting coordinates without affecting entered addresses.
Setting Up and Using the Geocoder Field
Follow these steps to configure and use the Geocoder Field effectively:
Add the Field: First, drag and drop the Geocoder Field into your Ninja Forms form.
Configure Defaults: Next, set default coordinates and marker options as needed.
Link Fields: Connect Address, Coordinates, and Map Fields to the Geocoder Field for data synchronization.
Customize Marker Behavior: Adjust settings such as marker visibility, dragging permissions, and map interactions.
Test the Form: Preview and test your form to ensure proper geolocation synchronization.
Interactive Front-End Preview
Discover the plugin in action on our interactive front-end demo site.