Returns the distance between built-in addresses in ChartHop in the specified units.
distance(point1, point2[, 'unit'])
- point1 - the first location from which to measure distance.
- point2 - the destination to which the function measures distance.
- unit - (optional) the units of the returned distance.
- Accepted values are: meters (default), miles, km.
- Return type: Number
distance(address, workAddress, 'meters') returns the distance in meters.
distance(address, workAddress, 'miles') returns the distance in miles.