Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

GeoPoint

An immutable object representing a geographic location in Firestore. The location is represented as latitude/longitude pair.

Latitude values are in the range of [-90, 90]. Longitude values are in the range of [-180, 180].

class GeoPoint {
constructor(latitude: number, longitude: number);
get latitude(): number;
get longitude(): number;
 
isEqual(other: GeoPoint): boolean;
toJSON(): {
latitude: number;
longitude: number;
type: string;
}
;
 
static fromJSON(json: object): GeoPoint;
}

§Constructors

§
new GeoPoint(latitude: number, longitude: number)
[src]

Creates a new immutable GeoPoint object with the provided latitude and longitude values.

@param latitude
  • The latitude as number between -90 and 90.
@param longitude
  • The longitude as number between -180 and 180.

§Properties

§
latitude: number readonly
[src]

The latitude of this GeoPoint instance.

§
longitude: number readonly
[src]

The longitude of this GeoPoint instance.

§Methods

§
isEqual(other: GeoPoint): boolean
[src]

Returns true if this GeoPoint is equal to the provided one.

@param other
  • The GeoPoint to compare against.
@return

true if this GeoPoint is equal to the provided one.

§
toJSON(): {
latitude: number;
longitude: number;
type: string;
}
[src]

Returns a JSON-serializable representation of this GeoPoint instance.

@return

a JSON representation of this object.

§Static Methods

§
fromJSON(json: object): GeoPoint
[src]

Builds a GeoPoint instance from a JSON object created by GeoPoint.toJSON.

@param json

a JSON object represention of a GeoPoint instance

@return

an instance of GeoPoint if the JSON object could be parsed. Throws a FirestoreError if an error occurs.