All Collections
Automation
Functions
Function DirectDistance()
Function DirectDistance()

Use DirectDistance() to get the direct distance between any two locations in your Mapsly org's distance units

Sergey Shurygin avatar
Written by Sergey Shurygin
Updated over a week ago

Use DirectDistance() to find out the distance between two locations.

How to use

  • DirectDistance(lat1, lng1, lat2, lng2)

Input

  • lat1, lng1, lat2, lng2 (decimal or text): latitude and longitude coordinates (in Radians) of the points between which to calculate the direct distance.

Output

Distance in the distance units currently selected in your Mapsly org's profile settings, miles or kilometers.

Example

  • DirectDistance(37.78570, -122.40106, record.mapsly_geo_lat, record.mapsly_geo_lng) - returns the direct distance from the San Francisco Museum of Modern Art to the current record's location, in kilometers or miles (depending on the Mapsly org's current distance unit).

See also

Did this answer your question?