Struct GeoPoint
Immutable struct representing a geographic location in Firestore.
Implements
Inherited Members
Namespace: Google.Cloud.Firestore
Assembly: Google.Cloud.Firestore.dll
Syntax
public struct GeoPoint : IEquatable<GeoPoint>
Constructors
GeoPoint(double, double)
Creates a new value using the provided latitude and longitude values.
Declaration
public GeoPoint(double latitude, double longitude)
Parameters
Type | Name | Description |
---|---|---|
double | latitude | The latitude of the point in degrees, between -90 and 90 inclusive. |
double | longitude | The longitude of the point in degrees, between -180 and 180 inclusive. |
Properties
Latitude
The latitude, in degrees, in the range -90 to 90 inclusive.
Declaration
public double Latitude { get; }
Property Value
Type | Description |
---|---|
double |
Longitude
The longitude, in degrees, in the range -180 to 180 inclusive.
Declaration
public double Longitude { get; }
Property Value
Type | Description |
---|---|
double |
Methods
FromProto(LatLng)
Creates an instance from a Protobuf LatLng representation. Later modifications to the Protobuf representation will not affect the returned object.
Declaration
public static GeoPoint FromProto(LatLng proto)
Parameters
Type | Name | Description |
---|---|---|
LatLng | proto | A Protobuf location representation. |
Returns
Type | Description |
---|---|
GeoPoint | A new GeoPoint value. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
ToProto()
Creates a Protobuf LatLng representation of this point. Modifications to the returned message will not be reflected in this object.
Declaration
public LatLng ToProto()
Returns
Type | Description |
---|---|
LatLng | A Protobuf location representation. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
Operators
operator ==(GeoPoint, GeoPoint)
Operator overload to compare two GeoPoint values for equality.
Declaration
public static bool operator ==(GeoPoint lhs, GeoPoint rhs)
Parameters
Type | Name | Description |
---|---|---|
GeoPoint | lhs | Left value to compare |
GeoPoint | rhs | Right value to compare |
Returns
Type | Description |
---|---|
bool | true if |
operator !=(GeoPoint, GeoPoint)
Operator overload to compare two GeoPoint values for inequality.
Declaration
public static bool operator !=(GeoPoint lhs, GeoPoint rhs)
Parameters
Type | Name | Description |
---|---|---|
GeoPoint | lhs | Left value to compare |
GeoPoint | rhs | Right value to compare |
Returns
Type | Description |
---|---|
bool | false if |