class
GeoPoint
Source: geo-point.
An immutable object representing a geographic location in Firestore. The location is represented as a latitude/longitude pair.
Method
new GeoPoint(latitude, longitude)
Creates a GeoPoint.
Example
let data = {
google: new Firestore.GeoPoint(37.422, 122.084)
};
firestore.doc('col/doc').set(data).then(() => {
console.log(`Location is ${data.google.latitude}, ` +
`${data.google.longitude}`);
});
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
latitude |
|
|
The latitude as a number between -90 and 90. |
|
longitude |
|
|
The longitude as a number between -180 and 180. |
Properties
read-only
latitude number
The latitude as a number between -90 and 90.
read-only
longitude number
The longitude as a number between -180 and 180.
Method
isEqual(other) → boolean
Returns true if this GeoPoint is equal to the provided value.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
other |
any type |
|
The value to compare against. |
- Returns
-
booleantrue if this
GeoPointis equal to the provided value.