CoreLocation.distanceFromLocation
---------------------------------

Returns the distance (in meters) from the receiver's location to the specified location.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CoreLocation](component_CoreLocation.md) | [2.7](newinversion27.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "CoreLocation.distanceFromLocation"; Latitude; Longitude ) 

**MBS**( **"CoreLocation.distanceFromLocation";** /\* Returns the distance (in meters) from the receiver's location to the specified location. \*/  
**$Latitude**; /\* The latitude value for the geo coordinate.e.g. 51.50939 \*/   
**$Longitude**) /\* The latitude value for the geo coordinate.e.g. -0.11832 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Latitude | The latitude value for the geo coordinate. | 51.50939 |
| Longitude | The latitude value for the geo coordinate. | -0.11832 |

### Result

Returns distance in meters.

### Description

Returns the distance (in meters) from the receiver's location to the specified location.  
This method measures the distance between the two locations by tracing a line between them that follows the curvature of the Earth. The resulting arc is a smooth curve and does not take into account specific altitude changes between the two locations.  
### Examples

Return distance from London

 MBS ( "CoreLocation.distanceFromLocation"; 51.50939 , -0.11832 )  
### Example Databases

- [Mac and iOS/CoreLocation/CoreLocation](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/CoreLocation/CoreLocation.shtml#2ScriptAnchor_)

This function checks for a license.

Created 18th August 2014 , last changed 18th August 2014

  
[CoreLocation.distanceFilter](CoreLocationdistanceFilter.md) - [CoreLocation.hasLocation](CoreLocationhasLocation.md)

[HTML Version](CoreLocationdistanceFromLocation.shtml)