API Docs for: 0.0.2
Show:

core.addons.CoreLocation Class

Extends core.events.EventDispatcher
Module: addons

The main class that implements HTML5 Geolocation functions.

Constructor

core.addons.CoreLocation

(
  • opts
)

Parameters:

  • opts Object

    An object containing configurations required by the Core derived class.

    • el HTMLElement

      The node element included in the class composition.

Methods

getDistanceFromCurrentLocation

(
  • point
)

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
)

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

()

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