The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/firestore > / > GeoPoint

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:

export declare class GeoPoint 

Constructors

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

Properties

Property Modifiers Type Description
latitude number The latitude of this GeoPoint instance.
longitude number The longitude of this GeoPoint instance.

Methods

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