Show / Hide Table of Contents

    Struct Position

    Structure holding latitude and longitude of a position in spherical coordinate system

    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Mapsui.UI.Forms
    Assembly: Mapsui.UI.Forms.dll
    Syntax
    public struct Position

    Constructors

    | Improve this Doc View Source

    Position(Position)

    Initializes a new instance of the Position from position

    Declaration
    public Position(Position point)
    Parameters
    Type Name Description
    Position point

    Position to use

    | Improve this Doc View Source

    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
    System.Double latitude

    Latitude of position

    System.Double longitude

    Longitude of position

    Fields

    | Improve this Doc View Source

    DecimalDegrees

    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
    System.String
    | Improve this Doc View Source

    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
    System.String
    | Improve this Doc View Source

    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
    System.String

    Properties

    | Improve this Doc View Source

    Latitude

    Latitude of position

    Declaration
    public double Latitude { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    Longitude

    Longitude of position

    Declaration
    public double Longitude { get; }
    Property Value
    Type Description
    System.Double

    Methods

    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()
    | Improve this Doc View Source

    ToMapsui()

    Convert Xamarin.Forms.Maps.Position to Mapsui.Geometries.Point

    Declaration
    public Point ToMapsui()
    Returns
    Type Description
    Point

    Position in Mapsui format

    | Improve this Doc View Source

    ToString()

    Returns a System.String that represents the current Position

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    A System.String that represents the current Position

    Overrides
    System.ValueType.ToString()
    | Improve this Doc View Source

    ToString(String)

    Returns a System.String that represents the current Position in a given format

    Declaration
    public string ToString(string format)
    Parameters
    Type Name Description
    System.String format

    Format string

    Returns
    Type Description
    System.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

    | Improve this Doc View Source

    Equality(Position, Position)

    Declaration
    public static bool operator ==(Position left, Position right)
    Parameters
    Type Name Description
    Position left
    Position right
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Inequality(Position, Position)

    Declaration
    public static bool operator !=(Position left, Position right)
    Parameters
    Type Name Description
    Position left
    Position right
    Returns
    Type Description
    System.Boolean
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX