Struct Position
Structure holding latitude and longitude of a position in spherical coordinate system
Inherited Members
Namespace: Mapsui.UI.Maui
Assembly: Mapsui.UI.Maui.dll
Syntax
public struct Position
Constructors
| Edit this page View SourcePosition(Position)
Initializes a new instance of the Position from position
Declaration
public Position(Position point)
Parameters
Type | Name | Description |
---|---|---|
Position | point | Position to use |
Position(double, double)
Initializes a new instance of the Position from latitude and longitude
Declaration
public Position(double latitude, double longitude)
Parameters
Type | Name | Description |
---|---|---|
double | latitude | Latitude of position |
double | longitude | Longitude of position |
Fields
| Edit this page View SourceDecimalDegrees
Format for coordinates with decimal degrees
Declaration
public const string DecimalDegrees = "P DD.ddd°|P DDD.ddd°|N|S|E|W"
Field Value
Type | Description |
---|---|
string |
DecimalMinutes
Format for coordinates with decimal minutes
Declaration
public const string DecimalMinutes = "P DD° MM.MMM'|P DDD° MM.MMM'|N|S|E|W"
Field Value
Type | Description |
---|---|
string |
DecimalSeconds
Format for coordinates with decimal seconds
Declaration
public const string DecimalSeconds = "P DD° MM' SS.sss\"|P DDD° MM' SS.sss\"|N|S|E|W"
Field Value
Type | Description |
---|---|
string |
Properties
| Edit this page View SourceLatitude
Latitude of position
Declaration
public readonly double Latitude { get; }
Property Value
Type | Description |
---|---|
double |
Longitude
Longitude of position
Declaration
public readonly double Longitude { get; }
Property Value
Type | Description |
---|---|
double |
Methods
| Edit this page View SourceEquals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
| Edit this page View SourceGetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
| Edit this page View SourceToCoordinate()
Declaration
public Coordinate ToCoordinate()
Returns
Type | Description |
---|---|
Coordinate |
ToMapsui()
Convert Xamarin.Forms.Maps.Position to Mapsui.Geometries.Point
Declaration
public MPoint ToMapsui()
Returns
Type | Description |
---|---|
MPoint | Position in Mapsui format |
ToPoint()
Declaration
public Point ToPoint()
Returns
Type | Description |
---|---|
Point |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
| Edit this page View SourceToString(string)
Declaration
public string ToString(string format)
Parameters
Type | Name | Description |
---|---|---|
string | format | Format string |
Returns
Type | Description |
---|---|
string | Position as string |
Remarks
Format string has 6 parts. This are separated by a "|" character. The first part is the format for the latitude, the second the format for the longitude part. Than follow shortcuts for the orientations: north, south, east, west.
The parameters for the format for latitude and longitude are - P: Cardinal direction like north or east - D: Degrees as integer number. If there are more D than numbers, than there are trailing zeros. E.g. "DDD" and 13 is replaced as "013" - d: Decimal degrees as numbers. Each d is replaced with a number, e.g. "ddd" and 13.5467 degrees gives "546" - M: Minutes as integer number. If there are more M than numbers, than there are trailing zeros. E.g. "MM" and 5 is replaced as "05" - m: Decimal minutes as numbers. Each m is replaced with a number, e.g. "mmm" and 13.5467 minutes gives "546" - S: Seconds as integer number. If there are more S than numbers, than there are trailing zeros. E.g. "SS" and 5 is replaced as "05" - s: Decimal seconds as numbers. Each s is replaced with a number, e.g. "sss" and 13.5467 minutes gives "546"
Examples All following examples are for the position 38.959390°, -95.265483°. - The format string "P DD° MM.mmm'|P DDD° MM.mmm'|N|S|E|W" gives "N 38° 57.563' W 095° 15.928'". - The format string "PDD° MM.mmm'|PDDD° MM.mmm'||-||-" gives "38° 57.563' -095° 15.928'". - The format string "DD° MM' SS.sss" P|DDD° MM' SS.sss" P|North|South|East|West" gives "38° 57' 33.804" North 095° 15' 55.739" West".
Operators
| Edit this page View Sourceoperator ==(Position, Position)
Declaration
public static bool operator ==(Position left, Position right)
Parameters
Type | Name | Description |
---|---|---|
Position | left | |
Position | right |
Returns
Type | Description |
---|---|
bool |
operator !=(Position, Position)
Declaration
public static bool operator !=(Position left, Position right)
Parameters
Type | Name | Description |
---|---|---|
Position | left | |
Position | right |
Returns
Type | Description |
---|---|
bool |