Class GeoPoint (4.9.8)

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

Package

@google-cloud/firestore!

Constructors

(constructor)(latitude, longitude)

  constructor 
 ( 
 latitude 
 : 
  
 number 
 , 
  
 longitude 
 : 
  
 number 
 ); 
 

Creates a [GeoPoint] GeoPoint .

Parameters
Name Description
latitude number

The latitude as a number between -90 and 90.

longitude number

The longitude as a number between -180 and 180.

Properties

latitude

  get 
  
 latitude 
 () 
 : 
  
 number 
 ; 
 

The latitude as a number between -90 and 90.

{number} GeoPoint#latitude

Property Value
Type Description
number

longitude

  get 
  
 longitude 
 () 
 : 
  
 number 
 ; 
 

The longitude as a number between -180 and 180.

{number} GeoPoint#longitude

Property Value
Type Description
number

Methods

fromProto(proto)

  static 
  
 fromProto 
 ( 
 proto 
 : 
  
 google 
 . 
 type 
 . 
 ILatLng 
 ) 
 : 
  
 GeoPoint 
 ; 
 

Converts a google.type.LatLng proto to its GeoPoint representation.

Parameter
Name Description
proto google.type.ILatLng
Returns
Type Description
GeoPoint

isEqual(other)

  isEqual 
 ( 
 other 
 : 
  
 firestore 
 . 
 GeoPoint 
 ) 
 : 
  
 boolean 
 ; 
 

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

Parameter
Name Description
other firestore.GeoPoint

The value to compare against. {boolean} true if this GeoPoint is equal to the provided value.

Returns
Type Description
boolean

toProto()

  toProto 
 () 
 : 
  
 api 
 . 
 IValue 
 ; 
 

Converts the GeoPoint to a google.type.LatLng proto.

Returns
Type Description
api.IValue
Design a Mobile Site
View Site in Mobile | Classic
Share by: