CLGeocoder.Distance
-------------------

Returns the distance (in meters) of the two locations.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CLGeocoder](component_CLGeocoder.md) | [6.1](newinversion61.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "CLGeocoder.Distance"; latitude1; longitude1; latitude2; longitude2 ) 

**MBS**( **"CLGeocoder.Distance";** /\* Returns the distance (in meters) of the two locations. \*/  
**$latitude1**; /\* The latitude value for the geo coordinate.e.g. 51.50939 \*/   
**$longitude1**; /\* The latitude value for the geo coordinate.e.g. -0.11832 \*/   
**$latitude2**; /\* The latitude value for the geo coordinate.e.g. 52.518611 \*/   
**$longitude2**) /\* The latitude value for the geo coordinate.e.g. 13.408333 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| latitude1 | The latitude value for the geo coordinate. | 51.50939 |
| longitude1 | The latitude value for the geo coordinate. | -0.11832 |
| latitude2 | The latitude value for the geo coordinate. | 52.518611 |
| longitude2 | The latitude value for the geo coordinate. | 13.408333 |

### Result

Returns number or error.

### Description

Returns the distance (in meters) of the two locations.  
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

Returns distance between London and Berlin:

 MBS ( "CLGeocoder.Distance"; 51.50939 ; -0.11832 ; 52.518611 ; 13.408333 )  
### See also

- [CLGeocoder.Cancel](CLGeocoderCancel.md)

### Example Databases

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

### Blog Entries

- [MBS FileMaker Plugin, version 6.1pr3](https://www.mbsplugins.de/archive/2016-02-25/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th February 2016 , last changed 9th November 2021

  
[CLGeocoder.Close](CLGeocoderClose.md) - [CLGeocoder.Done](CLGeocoderDone.md)

[HTML Version](CLGeocoderDistance.shtml)