Class Location

    Definition

    Namespace:
    Tizen.Location
    Assembly:
    Tizen.Location.dll

    This class contains details of the location requested. Includes the functionality to get the distance between locations.

    public class Location
    Inheritance
    object
    Location

    Constructors

    View Source

    Location()

    The default constructor of the Location class.

    Declaration
    public Location()
    View Source

    Location(double, double, double, double, double, double, int)

    The parameterized constructor of the Location class.

    Declaration
    public Location(double latitude, double longitude, double altitude, double speed, double direction, double accuracy, int timestamp)
    Parameters
    Type Name Description
    double latitude

    The latitude component of the device co-ordinate [-90.0 ~ 90.0] (degrees).

    double longitude

    The longitude component of the device co-ordinate[-180.0 ~ 180.0] (degrees).

    double altitude

    The altitude value.

    double speed

    The device speed.

    double direction

    The device direction with respect to the north.

    double accuracy

    The accuracy in meters.

    int timestamp

    Time when the measurement took place.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when an invalid argument is used.

    Properties

    View Source

    Accuracy

    The accuracy.

    Declaration
    public double Accuracy { get; set; }
    Property Value
    Type Description
    double
    View Source

    Altitude

    The current altitude (meters).

    Declaration
    public double Altitude { get; set; }
    Property Value
    Type Description
    double
    View Source

    Direction

    The direction and degrees from the north.

    Declaration
    public double Direction { get; set; }
    Property Value
    Type Description
    double
    View Source

    Latitude

    The current latitude [-90.0 ~ 90.0] (degrees).

    Declaration
    public double Latitude { get; set; }
    Property Value
    Type Description
    double
    View Source

    Longitude

    The current longitude [-180.0 ~ 180.0] (degrees).

    Declaration
    public double Longitude { get; set; }
    Property Value
    Type Description
    double
    View Source

    Speed

    The device speed (km/h).

    Declaration
    public double Speed { get; set; }
    Property Value
    Type Description
    double
    View Source

    Timestamp

    The time value when the measurement was done.

    Declaration
    public DateTime Timestamp { get; }
    Property Value
    Type Description
    System.DateTime

    Methods

    View Source

    GetDistanceBetween(double, double, double, double)

    Gets the distance between the two given coordinates.

    Declaration
    public static double GetDistanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude)
    Parameters
    Type Name Description
    double startLatitude

    The latitude of the source location [-90.0 ~ 90.0] (degrees).

    double startLongitude

    The longitude of the source location[-180.0 ~ 180.0] (degrees).

    double endLatitude

    The latitude of the source location [-90.0 ~ 90.0] (degrees).

    double endLongitude

    The longitude of the source location[-180.0 ~ 180.0] (degrees).

    Returns
    Type Description
    double

    Returns the distance between the source and the destination.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when an invalid argument is used.

    System.NotSupportedException

    Thrown when the location is not supported.

    View Source

    GetDistanceTo(Location)

    Gets the distance between the current and the specified location.

    Declaration
    public double GetDistanceTo(Location location)
    Parameters
    Type Name Description
    Location location

    The location object to which distance is to be calculated.

    Returns
    Type Description
    double

    Returns the distance to the specified location.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when an invalid argument is used.

    System.NotSupportedException

    Thrown when the location is not supported.

    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX