API Docs for:

Class Parse.GeoPoint

Creates a new GeoPoint with any of the following forms:

  new GeoPoint(otherGeoPoint)
  new GeoPoint(30, 30)
  new GeoPoint([30, 30])
  new GeoPoint({latitude: 30, longitude: 30})
  new GeoPoint()  // defaults to (0, 0)
  
Parse.GeoPoint( )
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:
  • options <Object>

    An object with success and error callbacks.

Number kilometersTo( point )

Returns the distance from this GeoPoint to another in kilometers.

Parameters:
Returns: <Number>
Number milesTo( point )

Returns the distance from this GeoPoint to another in miles.

Parameters:
Returns: <Number>
Number radiansTo( point )

Returns the distance from this GeoPoint to another in radians.

Parameters:
Returns: <Number>
Object toJSON( )

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


Returns: <Object>
latitude <Number>

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

longitude <Number>

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