Constructor
new GeoPoint()
- Source:
Creates a new GeoPoint with any of the following forms:
Example
new GeoPoint(otherGeoPoint)
new GeoPoint(30, 30)
new GeoPoint([30, 30])
new GeoPoint({latitude: 30, longitude: 30})
new GeoPoint() // defaults to (0, 0)
Methods
(static) current() → {Promise.<AV.GeoPoint>}
- Source:
Creates a GeoPoint with the user's current location, if available.
Returns:
- Type
- Promise.<AV.GeoPoint>
kilometersTo(point) → {Number}
- Source:
Returns the distance from this GeoPoint to another in kilometers.
Parameters:
Name | Type | Description |
---|---|---|
point |
AV.GeoPoint | the other AV.GeoPoint. |
Returns:
- Type
- Number
milesTo(point) → {Number}
- Source:
Returns the distance from this GeoPoint to another in miles.
Parameters:
Name | Type | Description |
---|---|---|
point |
AV.GeoPoint | the other AV.GeoPoint. |
Returns:
- Type
- Number
radiansTo(point) → {Number}
- Source:
Returns the distance from this GeoPoint to another in radians.
Parameters:
Name | Type | Description |
---|---|---|
point |
AV.GeoPoint | the other AV.GeoPoint. |
Returns:
- Type
- Number
toJSON() → {Object}
- Source:
Returns a JSON representation of the GeoPoint, suitable for AV.
Returns:
- Type
- Object