Search Results for

    Show / Hide Table of Contents

    Struct Position

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

    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Mapsui.UI.Maui
    Assembly: Mapsui.UI.Maui.dll
    Syntax
    public struct Position

    Constructors

    | Edit this page 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

    | Edit this page 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
    double latitude

    Latitude of position

    double longitude

    Longitude of position

    Fields

    | Edit this page 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
    string
    | Edit this page 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
    string
    | Edit this page 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
    string

    Properties

    | Edit this page View Source

    Latitude

    Latitude of position

    Declaration
    public readonly double Latitude { get; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    Longitude

    Longitude of position

    Declaration
    public readonly double Longitude { get; }
    Property Value
    Type Description
    double

    Methods

    | Edit this page View Source

    Equals(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 obj and this instance are the same type and represent the same value; otherwise, false.

    Overrides
    ValueType.Equals(object)
    | Edit this page View Source

    GetHashCode()

    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
    ValueType.GetHashCode()
    | Edit this page View Source

    ToCoordinate()

    Declaration
    public Coordinate ToCoordinate()
    Returns
    Type Description
    Coordinate
    | Edit this page View Source

    ToMapsui()

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

    Declaration
    public MPoint ToMapsui()
    Returns
    Type Description
    MPoint

    Position in Mapsui format

    | Edit this page View Source

    ToPoint()

    Declaration
    public Point ToPoint()
    Returns
    Type Description
    Point
    | Edit this page View Source

    ToString()

    Returns a string that represents the current Position

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string that represents the current Position

    Overrides
    ValueType.ToString()
    | Edit this page View Source

    ToString(string)

    Returns a string that represents the current Position in a given format

    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 Source

    operator ==(Position, Position)

    Declaration
    public static bool operator ==(Position left, Position right)
    Parameters
    Type Name Description
    Position left
    Position right
    Returns
    Type Description
    bool
    | Edit this page View Source

    operator !=(Position, Position)

    Declaration
    public static bool operator !=(Position left, Position right)
    Parameters
    Type Name Description
    Position left
    Position right
    Returns
    Type Description
    bool
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX