Constructor
new GeoPoint(options, longitude)
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Array.<Number>
|
Object
|
Number
|
Either a list of coordinate pairs, an object with `latitude`, `longitude`, or the latitude or the point. |
longitude |
Number
|
The longitude of the GeoPoint |
Members
latitude :Number
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 |
Type:
-
Number
longitude :Number
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 |
Type:
-
Number
Methods
(static) current(options)
Creates a GeoPoint with the user's current location, if available.
Calls options.success with a new GeoPoint instance or calls options.error.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Object
|
An object with success and error callbacks. |
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