Choose where you’d like to start

Distance Between

Overview

The zoho.map.distanceBetween task returns the flight distance between the specified source and destination addresses.

Note:

  • Zoho Maps use open-source address data. Hence, accuracy might not be on par with commercial vendors.
  • This task is available only in US, EU, IN domains due to the availability of Zoho Maps.

Syntax

<response> = zoho.map.distanceBetween(<source_address>, <destination_address, <unit>);

where:

ParamsData typeDescription
<response>NUMBERThe distance between the specified source and destination addresses.
<source_address>TEXTThe source address from which the flight distance needs to be calculated.
<destination_address>TEXTThe destination address until which the flight distance needs to be calculated.
<unit>TEXT

The unit in which the distance needs to be returned.

  • MILE
  • KILOMETRE
  • NAUTICAL

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
The NUMBER variable that holds distance (in miles) between the specified addresses. This example returns 9458.287130449206.
"Chennai, Tamil Nadu, India"
The TEXT that represents the source address.
"Austin, Texas, US"
The TEXT that represents the destination address.
"MILE"
The TEXT that represents the unit in which the distance needs to be returned.

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"
     }

Related Links

Get Started Now

Execute