Distance Calculation
![distance calculation 1](https://piotnetforms.com/wp-content/uploads/2020/09/distance-calculation-1.png)
- You need to add Google Map Key. https://piotnetforms.com/docs/google-address-autocomplete/
- Go to https://console.cloud.google.com/google/maps-apis/api-list > Enable Distance Matrix API
You can calculate the distance between 2 Address Autocomplete Fields (e.g. taxi service) or From a Specific Location to an Address Autocomplete Field (e.g. from your store to your customer’s address)
Calculated Distance between 2 Address Autocomplete Fields
![distance calculation 2](https://piotnetforms.com/wp-content/uploads/2020/09/distance-calculation-2.png)
- Create 2 Address Autocomplete Fields (e.g. location_a and location_b)
- Create a Calculated Field > Enable Distance Calculation > Enter From Field Shortcode and To Field Shortcode
Calculated Distance From Specific Location to an Address Autocomplete Fields
![distance calculation 3](https://piotnetforms.com/wp-content/uploads/2020/09/distance-calculation-3.png)
- Create an Address Autocomplete Fields (e.g. location_b)
- Create a Calculated Field > Enable Distance Calculation > Enter From Location (Please go to https://www.google.com/maps and type your address to get the exact location) > Enter To Field Shortcode