GeoPoint class

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].

Signature:

exportdeclareclassGeoPoint

Constructors

ConstructorModifiersDescription
(constructor)(latitude, longitude)Creates a new immutable GeoPoint object with the provided latitude and longitude values.

Properties

PropertyModifiersTypeDescription
latitudenumberThe latitude of this GeoPoint instance.
longitudenumberThe longitude of this GeoPoint instance.

Methods

MethodModifiersDescription
isEqual(other)Returns true if this GeoPoint is equal to the provided one.
toJSON()Returns a JSON-serializable representation of this GeoPoint.

GeoPoint.(constructor)

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

Signature:

constructor(latitude:number,longitude:number);

Parameters

ParameterTypeDescription
latitudenumberThe latitude as number between -90 and 90.
longitudenumberThe longitude as number between -180 and 180.

GeoPoint.latitude

The latitude of this GeoPoint instance.

Signature:

getlatitude():number;

GeoPoint.longitude

The longitude of this GeoPoint instance.

Signature:

getlongitude():number;

GeoPoint.isEqual()

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

Signature:

isEqual(other:GeoPoint):boolean;

Parameters

ParameterTypeDescription
otherGeoPointThe GeoPoint to compare against.

Returns:

boolean

true if this GeoPoint is equal to the provided one.

GeoPoint.toJSON()

Returns a JSON-serializable representation of this GeoPoint.

Signature:

toJSON():{latitude:number;longitude:number;};

Returns:

{ latitude: number; longitude: number; }