Class: GeoPosition

GeoPosition

new GeoPosition(navigator, options)

Create a new GeoPosition.
Parameters:
Name Type Description
navigator Object provides access to geolocation system
options Object parameters for initializing this GeoPosition
Properties
Name Type Attributes Default Description
geoListenEnabled Boolean <optional>
false whether or not to attempt to use geolocation
Source:

Methods

connect(geoUpdateCallback)

Attempts to get an initial rough geographic location for the listener, then sets up a callback to update the position.
Parameters:
Name Type Description
geoUpdateCallback function object that should receive geolocation coordinate updates
Source:
See:
  • geoListenEnabled

toString() → {String}

Source:
Returns:
Human-readable representation of this GeoPosition
Type
String

waitForInitialGeolocation() → {Promise}

Allows you to wait on the progress of the .connect() behavior, attempting to get an initial estimate of the user's position. Note that this promise will never fail - if we cannot get an accurate estimate, we fall back to default coordinates (currently latitude 1, longitude 1)
Source:
Returns:
Represents the attempt to get an initial estimate of the user's position
Type
Promise

GeoPosition

Responsible for tracking the user's position, when geo listening is enabled and the browser is capable

Constructor

new GeoPosition()

Properties:
Name Type Description
geoListenEnabled Boolean whether or not the geo positioning system is enabled and available
Source:
See:

Methods

connect(geoUpdateCallback)

Attempts to get an initial rough geographic location for the listener, then sets up a callback to update the position.
Parameters:
Name Type Description
geoUpdateCallback function object that should receive geolocation coordinate updates
Source:
See:
  • geoListenEnabled

toString() → {String}

Source:
Returns:
Human-readable representation of this GeoPosition
Type
String

waitForInitialGeolocation() → {Promise}

Allows you to wait on the progress of the .connect() behavior, attempting to get an initial estimate of the user's position. Note that this promise will never fail - if we cannot get an accurate estimate, we fall back to default coordinates (currently latitude 1, longitude 1)
Source:
Returns:
Represents the attempt to get an initial estimate of the user's position
Type
Promise