Distance Calculation Using Refine and Google Maps API:
· Create two columns
o Origin – origin address (address can be anything – complete address, just city, start, zip, country or any combination of tose]
o Destination – destination address
· Create a new column “distance api response” based on Origin column using the url option
Copy this in expression field show below [if you use the column names Origin and Destination, you don’t have to change anything in this formula]
"http://maps.googleapis.com/maps/api/directions/json?origin="+escape(value, "url")+"&destination="+escape(cells["Destination"].value, "url")+"&sensor=false"
· Create a new column called “distance” – create it based on “distance api response” column and use the following formula in the expression
with(value.parseJson().routes[0].legs[0].distance,pair,pair.text)