# Class: Distance

## Distance

#### new Distance()

  Deprecated:
    - Will be dropped wiht the introduction of global distance units

### Members

#### <static, constant> KILOMETERS

  Kilometers, represented as false by legacy versions of the plugin

#### <static, constant> MILES

  Miles, represented as true by legacy versions of the plugin

#### <static, constant> MILES_PER_KILOMETER

  Miles per kilometer

### Methods

#### <static> between(The, The)

  Returns the distance, in kilometers, between two LatLng's

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `The` | WPGMZA.Latlng | first point
  `The` | WPGMZA.Latlng | second point

  ##### Returns:

  The distance, in kilometers
  Type
    number

#### <static> kilometersToUI(km, The)

  Converts kilometers to a UI distance, either the same value, or converted to miles depending on settings.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `km` | number | The input distance in kilometers
  `The` | number | UI distance in the units specified by settings

#### <static> uiToKilometers(uiDistance)

  Converts a UI distance (eg from a form control) to kilometers, accounting for the global units setting

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `uiDistance` | number | The distance from the UI, could be in miles or kilometers depending on settings

  ##### Returns:

  The input distance in kilometers
  Type
    number

#### <static> uiToMeters(uiDistance)

  Converts a UI distance (eg from a form control) to meters, accounting for the global units setting

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `uiDistance` | number | The distance from the UI, could be in miles or kilometers depending on settings

  ##### Returns:

  The input distance in meters
  Type
    number

#### <static> uiToMiles(uiDistance)

  Converts a UI distance (eg from a form control) to miles, according to settings

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `uiDistance` | number | The distance from the UI, could be in miles or kilometers depending on settings

  ##### Returns:

  The input distance
  Type
    number

#### Search results