core.addons.CoreLocation - core

#

API Docs for: 0.0.2
Show: Inherited Protected Private Deprecated

# core.addons.CoreLocation Class

Extends core.events.EventDispatcher
Defined in: `addons/location/geo.location.js:10`
Module: addons

The main class that implements HTML5 Geolocation functions.

## Constructor

### `core.addons.CoreLocation`

(

- `opts`

)

Defined in `addons/location/geo.location.js:10`

#### Parameters:

- `opts` Object

  An object containing configurations required by the Core derived class.

  - `el` HTMLElement

    The node element included in the class composition.

- Index
- Methods

## Item Index

### Methods

- getDistanceFromCurrentLocation
- getDistanceFromLocations
- update

## Methods

### `getDistanceFromCurrentLocation`

(

- `point`

)

Defined in `addons/location/geo.location.js:66`

Retrieves the distance from the last detected position. Returns distance result in km.

#### Parameters:

- `point` Object

  An object containing latitude and longitude properties.

  - `latitude` Number

    The latitude of the value to calculate distance.

  - `longitude` Number

    The longitude of the value to calculate distance.

### `getDistanceFromLocations`

(

- `point1`
- `point2`

)

Defined in `addons/location/geo.location.js:78`

Calculates the distance between 2 coordinates.

#### Parameters:

- `point1` Object

  An object containing latitude and longitude properties.

  - `latitude` Number

    The latitude of the value to calculate distance.

  - `longitude` Number

    The longitude of the value to calculate distance.

- `point2` Object

  An object containing latitude and longitude properties.

  - `latitude` Number

    The latitude of the value to calculate distance.

  - `longitude` Number

    The longitude of the value to calculate distance.

### `update`

()

Defined in `addons/location/geo.location.js:93`

Refreshes current location and last known location. Runs geolocation check again.