Using the Directions Field you can calculate the driving directions ( using Google Maps directions API ) or the straight line distance between 2 or more locations.
You can calculate the directions between an origin and destination locations, and you can add waypoints in between.
When calculating the driving distance, which uses Google Maps API, you can display the driving routes on the Google Map Field, you can output the driving steps using the Direction Panel Field, and you can populate other form fields ( text, hidden... ) with the values of the driving distance and duration.
When using the field to calculate the straight line distance, you can display the straight-line routes on the Google Map Field, and you can populate other form fields with the value of the distance ( duration is not available for straight-line calculation at the moment ).
The distance/directions are being calculated between different Geocoder fields. You can add as many Geocoder fields as you need to the form and sync them ( see Fields Syncing ) with other geolocation fields ( address, map, coordinates, etc... ) that will be used to find the locations for the distance calculation.
Back-end field options
Back-end field options
Directions Field Options
Select between driving directions and distance calculated by Google Maps API and a straight line ( "as the crow flies" ) distance.
You must select at least the geocoder fields that will be used as the origin and destination points. In addition, you can also select the geocoders that will be used as waypoints.
- Origin Geocoder - Select the Geocoder field that will be used as the origin location.
- Destination Geocoder - Select the Geocoder field that will be used as the destination location.
- Waypoints Geocoders - Select the geocoder fields that will be used as waypoints.
- Travel Mode - select the travel mode between driving, walking, bicycling, and transit. Note, this option is available when using driving directions only.
- Unit system - select between miles or kilometers.
- Map ID - select a Map field if you would like to display the routes. Note that you need to have a Map field present in the form.
- Polyline options - set the routes polyline attributes. You can set the color using "strokeColor", the weight using "strokeWeight", and the opacity using "strokeOpacity". You can set one or more attributes comma separated. For example: strokeColor:'#0088FF',strokeWeight:6,strokeOpacity:0.6.
Select a Directions Panel field if you would like to display the directions steps ( you need to have a Directions Panel field present in the form ). Note that this feature is available with the driving directions only.
Directions Trigger Options
- Directions Trigger Method - Select "Dynamically" to dynamically trigger the directions once geocoding took place in the form or select "Using a button" to trigger the directions with a click of a button.
- Get directions button label - enter the label for the button that will trigger the directions.
- Clear directions button label - enter the label for the button that will clear the directions. Otherwise, leave it blank to disable this button.