Documentation

Locator Button Field

Last modified: January 14, 2025

Introduction

The Locator Button Field in Gravity Geolocation allows users to fetch their current location directly within your Gravity Form. Designed for seamless integration, it synchronizes with the Geocoder Field and other Gravity Geolocation fields to ensure accurate location retrieval.

The Locator Button Field offers a range of configuration options, including geocoder synchronization, IP-based fallback for location retrieval, and customizable user feedback messages. These settings provide a robust and user-friendly geolocation experience for applications such as delivery requests, event check-ins, or location-based services.

Configuring the Locator Button Field

Customize the Locator Button Field settings to match your geolocation requirements.

Locator button options
Configuration panel showcasing the Locator Button Field options.

1. Geocoder Field

Select the Geocoder Field to link with the Locator Button Field. This step ensures the retrieved location is dynamically synchronized with other geolocation fields. See Geolocation Fields Syncing.


2. IP Address Locator

Define how the IP address should be used for location retrieval. Note: Ensure an IP provider is configured in the plugin settings under "IP Providers."

  • Disabled: Do not use IP-based location services (Default).
  • Default: Use the IP address as the primary method for location detection.
  • Fallback: Use IP-based location only if browser geolocation fails.

3. Action Messages

Customize user messages to enhance clarity during location retrieval.

Location Found Message

Enter a message to display when the user's location is successfully detected. Leave blank to disable this message. (Example: Location successfully detected!)

Location Failed Message

Enable to suppress the default error message when location detection fails. Errors will still appear in the developer console for troubleshooting.


Setting Up and Using the Locator Button Field

Follow these steps to configure and use the Locator Button Field:

  1. Add the Gravity Forms Locator Button: Insert it into your form using the Gravity Forms editor.
  2. Link to a Geocoder Field: Select a Geocoder Field to enable location synchronization across your form.
  3. Configure Settings: Adjust the Locator Button options, including IP fallback and user messages.
  4. Test Your Form: Preview the form to ensure the Locator Button retrieves and synchronizes location data correctly.
menu-circle