ParseGeoPoint

ParseGeoPoint

new ParseGeoPoint(arg1, arg2)

Parameters:
Name Type Description
arg1 Array.<number> | object | number

Either a list of coordinate pairs, an object with latitude, longitude, or the latitude or the point.

arg2 number

The longitude of the GeoPoint

Members

latitude

North-south portion of the coordinate, in range [-90, 90]. Throws an exception if set out of range in a modern browser.

Properties:
Name Type Description
latitude number

longitude

East-west portion of the coordinate, in range [-180, 180]. Throws if set out of range in a modern browser.

Properties:
Name Type Description
longitude number

Methods

kilometersTo(point) → {number}

Returns the distance from this GeoPoint to another in kilometers.

Parameters:
Name Type Description
point Parse.GeoPoint

the other Parse.GeoPoint.

Returns:
Type:
number

milesTo(point) → {number}

Returns the distance from this GeoPoint to another in miles.

Parameters:
Name Type Description
point Parse.GeoPoint

the other Parse.GeoPoint.

Returns:
Type:
number

radiansTo(point) → {number}

Returns the distance from this GeoPoint to another in radians.

Parameters:
Name Type Description
point Parse.GeoPoint

the other Parse.GeoPoint.

Returns:
Type:
number

toJSON() → {object}

Returns a JSON representation of the GeoPoint, suitable for Parse.

Returns:
Type:
object

(static) current(options) → {Promise.<Parse.GeoPoint>}

Creates a GeoPoint with the user's current location, if available.

Parameters:
Name Type Description
options object

The options.

Name Type Attributes Default Description
enableHighAccuracy boolean <optional>
false

A boolean value that indicates the application would like to receive the best possible results. If true and if the device is able to provide a more accurate position, it will do so. Note that this can result in slower response times or increased power consumption (with a GPS chip on a mobile device for example). On the other hand, if false, the device can take the liberty to save resources by responding more quickly and/or using less power. Default: false.

timeout number <optional>
Infinity

A positive long value representing the maximum length of time (in milliseconds) the device is allowed to take in order to return a position. The default value is Infinity, meaning that getCurrentPosition() won't return until the position is available.

maximumAge number <optional>
0

A positive long value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return. If set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position. If set to Infinity the device must return a cached position regardless of its age. Default: 0.

Returns:
Type:
Promise.<Parse.GeoPoint>

User's current location