Distance Between
Table of Contents
Overview
The zoho.map.distanceBetween task returns the flight distance between the specified source and destination addresses.
- Zoho Maps use open-source address data. Hence, accuracy might not be on par with commercial vendors.
- This task cannot be used in AU domain as Zoho Maps is not available for AU users.
Syntax
<response> = zoho.map.distanceBetween(<source_address>, <destination_address, <unit>);
where:
Params | Data type | Description |
<response> | NUMBER | The distance between the specified source and destination addresses. |
<source_address> | TEXT | The source address from which the flight distance needs to be calculated. |
<destination_address> | TEXT | The destination address until which the flight distance needs to be calculated. |
<unit> | TEXT | The unit in which the distance needs to be returned.
Note: This is an optional parameter in Zoho Creator. If the <unit> parameter is not specified, the distance is returned in miles by default. |
Example
The following script returns the flight distance (in miles) between the specified source and destination addresses:
response = zoho.map.distanceBetween("Chennai, Tamil Nadu, India", "Austin, Texas, US", "MILE");
where:
response
"Chennai, Tamil Nadu, India"
"Austin, Texas, US"
"MILE"
Response Format
Failure Response
The failure response for an undetectable source and destination addresses will be returned in the following format:
{
"error": "unable to geocode",
"status": "failure"
}