Struct GeographicCoordinate
Represents a location in latitude and longitude
Namespace: Unity.MARS.Data
Syntax
public struct GeographicCoordinate
Constructors
GeographicCoordinate(Double, Double)
Create a new GeographicCoordinate
Declaration
public GeographicCoordinate(double latitude, double longitude)
Parameters
Type | Name | Description |
---|---|---|
Double | latitude | Geographical location latitude. |
Double | longitude | Geographical location latitude. |
Fields
Invalid
Coordinates representing an invalid location.
Declaration
public static readonly GeographicCoordinate Invalid
Field Value
Type | Description |
---|---|
GeographicCoordinate |
latitude
Geographical location latitude.
Declaration
public double latitude
Field Value
Type | Description |
---|---|
Double |
longitude
Geographical location latitude.
Declaration
public double longitude
Field Value
Type | Description |
---|---|
Double |
Methods
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Operators
Implicit(LocationInfo to GeographicCoordinate)
Implicit conversion of a device's LocationInfo
to a new GeographicCoordinate
Declaration
public static implicit operator GeographicCoordinate(LocationInfo location)
Parameters
Type | Name | Description |
---|---|---|
LocationInfo | location | Device's location info |
Returns
Type | Description |
---|---|
GeographicCoordinate | Location in latitude and longitude |
Implicit(GeographicCoordinate to Vector2)
Implicit conversion of GeographicCoordinate
to a new Vector2
with no projection.
Declaration
public static implicit operator Vector2(GeographicCoordinate coordinate)
Parameters
Type | Name | Description |
---|---|---|
GeographicCoordinate | coordinate | location in latitude and longitude |
Returns
Type | Description |
---|---|
Vector2 | Location as a vector 2 |
Implicit(Vector2 to GeographicCoordinate)
Implicit conversion of Vector2
to a new GeographicCoordinate
with no projection.
Declaration
public static implicit operator GeographicCoordinate(Vector2 vec)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | vec | location as a vector 2 |
Returns
Type | Description |
---|---|
GeographicCoordinate | Location in latitude and longitude |