GeoPoint

The class representing a GeoPoint, which is an object representing the geographic coordinates for a location.
new GeoPoint()

Example

new GeoPoint(otherGeoPoint)
new GeoPoint(30, 30)
new GeoPoint([30, 30])
new GeoPoint({latitude: 30, longitude: 30})
new GeoPoint()  // defaults to (0, 0)
 

Members

latitude

Specifies the North-South position of the geographic coordinate. The valid range of values is [-90, 90]. Throws an exception if set out of range in a browser.
Type
  • Number
Default Value
  • 0

longitude

Specifies the East-West portion of the geographic coordinate, The valid range of values is [-180, 180]. Throws an exception if set out of range in a browser.
Type
  • Number
Default Value
  • 0

Methods

toJSON

toJSON() → {Object}
Returns a JSON representation of the GeoPoint.
Parameters
Returns
  • Object

toString

toString() → {String}
Returns a string representation of the GeoPoint, in the format of `latitude, longitude`.
Parameters
Returns
  • String