Documentation

Google Map Field

Last modified: January 14, 2025

Introduction

The Map Field in Gravity Geolocation allows you to integrate interactive maps directly into your Gravity Forms. This feature supports defining default map coordinates, restricting viewable map areas, and synchronizing with Geocoder Fields for dynamic location updates.

The Map Field is ideal for use cases such as delivery forms, travel bookings, and customer location tracking, providing an enhanced user experience with customizable map views and controls.

Configuring the Map Field in Gravity Forms

Use the settings below to customize the Map Field’s behavior, appearance, and synchronization in your Gravity Forms.

Map field options
Map Field options configuration panel.

1. Geocoder Fields

Select one or more Geocoder Fields to link with this map. This enables real-time synchronization with other geolocation fields, ensuring accurate location updates across the form. See Geolocation Fields Syncing.


2. Default Coordinates

Set the initial latitude and longitude for the map’s default view when the form loads.

  • Default Latitude: Enter the latitude for the map's starting view (Default Value: 40.7827096).
  • Default Longitude: Enter the longitude for the map's starting view (Default Value: -73.965309).

3. Map View Options

Customize the map’s appearance, type, zoom level, and dimensions.

Map Type

Choose the style of the map:

  • Roadmap: Standard street map view (Default).
  • Satellite: Satellite imagery view.
  • Hybrid: Combination of street map and satellite views.
  • Terrain: Physical map with elevation and terrain details.

Zoom Level

Set the map's default zoom level (Default Value: 12).

Map Dimensions

Define the height and width of the map:

  • Map Height: Specify the map’s height in pixels or percentage (Default Value: 300px).
  • Map Width: Specify the map’s width in pixels or percentage (Default Value: 100%).

Map Styles

Apply custom map styles to change the map's appearance. Use predefined JSON styles for customization. You can find a variety of ready-made styles on platforms like Snazzy Maps or refer to the Google Maps Styling Documentation to create your own.

Mouse Scroll Zoom

Enable or disable zooming the map using the mouse scroll wheel.


4. Bounds Restriction

Restrict the map’s viewable area to specific boundaries using geographic coordinates. This ensures user inputs remain within a predefined region.

  • Southwest Point: Enter the southwest corner coordinates (Example: 26.423277,-82.137132).
  • Northeast Point: Enter the northeast corner coordinates (Example: 26.4724595,-82.021776).

Setting Up and Using the Map Field

Follow these steps to set up and use the Map Field in your Gravity Forms:

  1. Add a Map Field: Insert the Map Field into your form via the Gravity Forms editor.
  2. Sync with Geocoder Fields: Link the Map Field to Geocoder Fields for real-time geolocation updates.
  3. Customize Map Settings: Configure default coordinates, map view options, and bounds restrictions as needed.
  4. Test Your Configuration: Preview the form to ensure the map functions as expected and updates accurately.
menu-circle