A field of the 'Map' type can be added to the form in the Form Builder. To do this, click the "Add new field" button and select the appropriate field type in the "Separators and other" section, as shown in the screenshot below.
To demonstrate all the possibilities of the new field, we also added two address fields:
If you open the Map field for editing in the Form Builder, you will see that the following options are available:
- "Hide field name" allows you to hide the field name, as often you just need to show the map without names.
- "Width" and "Height" allow you to adjust the size of the map.
- "Zoom" allows you to set the default map zoom
- "Map center" allows you to set the Address or Map center coordinates
- "Show route" allows you to select two fields on the form, which will be used to build the route
- "Show distance" calculates the distance between two addresses
- "Distance in kilometers", when this option is disabled, the distance will be calculated in miles
- "Hide map" can be useful if you do not want to show the map with the route, but only the distance between two points
Below is a form for the route and distance:
The Form Builder has the ability to hide the Submit button. Thus, in combination with the "Hide map" option, you can create a distance calculation form:
Please note that route and distance calculations have resource limitations. Each request to Google is considered an API call * 10 and will be displayed in the corresponding section on the "Payment and statistics" page.
The map will not be displayed in the table at the moment, but will work in the entry editing form, as well as on the Entry page or Entry Widget.
We hope you find the new field useful!