Class Location
Definition
- 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
-
objectLocation
Constructors
View SourceLocation()
The default constructor of the Location class.
Declaration
public Location()
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 SourceAccuracy
The accuracy.
Declaration
public double Accuracy { get; set; }
Property Value
Type | Description |
---|---|
double |
Altitude
The current altitude (meters).
Declaration
public double Altitude { get; set; }
Property Value
Type | Description |
---|---|
double |
Direction
The direction and degrees from the north.
Declaration
public double Direction { get; set; }
Property Value
Type | Description |
---|---|
double |
Latitude
The current latitude [-90.0 ~ 90.0] (degrees).
Declaration
public double Latitude { get; set; }
Property Value
Type | Description |
---|---|
double |
Longitude
The current longitude [-180.0 ~ 180.0] (degrees).
Declaration
public double Longitude { get; set; }
Property Value
Type | Description |
---|---|
double |
Speed
The device speed (km/h).
Declaration
public double Speed { get; set; }
Property Value
Type | Description |
---|---|
double |
Timestamp
The time value when the measurement was done.
Declaration
public DateTime Timestamp { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
Methods
View SourceGetDistanceBetween(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. |
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. |