Class Location
Definition
- Namespace:
- Tizen.Location
- Assembly:
- Tizen.Location.dll
- API Level:
- 3
This class contains details of the location requested. Includes the functionality to get the distance between locations.
C#Copypublic class Location
- Inheritance
-
Location
Constructors
Declaration
C#Copypublic Location()
API Level: 3
Location(Double, Double, Double, Double, Double, Double, Int32)
The parameterized constructor of the Location class.
Declaration
C#Copypublic Location(double latitude, double longitude, double altitude, double speed, double direction, double accuracy, int timestamp)
Parameters
Type | Name | Description |
---|---|---|
System.Double | latitude | The latitude component of the device co-ordinate [-90.0 ~ 90.0] (degrees). |
System.Double | longitude | The longitude component of the device co-ordinate[-180.0 ~ 180.0] (degrees). |
System.Double | altitude | The altitude value. |
System.Double | speed | The device speed. |
System.Double | direction | The device direction with respect to the north. |
System.Double | accuracy | The accuracy in meters. |
System.Int32 | timestamp | Time when the measurement took place. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when an invalid argument is used. |
API Level: 3
Properties
Declaration
C#Copypublic double Accuracy { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
API Level: 3
Declaration
C#Copypublic double Altitude { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
API Level: 3
Declaration
C#Copypublic double Direction { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
API Level: 3
Declaration
C#Copypublic double Latitude { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
API Level: 3
Declaration
C#Copypublic double Longitude { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
API Level: 3
Declaration
C#Copypublic double Speed { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
API Level: 3
Declaration
C#Copypublic DateTime Timestamp { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
API Level: 3
Methods
GetDistanceBetween(Double, Double, Double, Double)
Gets the distance between the two given coordinates.
Declaration
C#Copypublic static double GetDistanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude)
Parameters
Type | Name | Description |
---|---|---|
System.Double | startLatitude | The latitude of the source location [-90.0 ~ 90.0] (degrees). |
System.Double | startLongitude | The longitude of the source location[-180.0 ~ 180.0] (degrees). |
System.Double | endLatitude | The latitude of the source location [-90.0 ~ 90.0] (degrees). |
System.Double | endLongitude | The longitude of the source location[-180.0 ~ 180.0] (degrees). |
Returns
Type | Description |
---|---|
System.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. |
API Level: 3
GetDistanceTo(Location)
Gets the distance between the current and the specified location.
Declaration
C#Copypublic double GetDistanceTo(Location location)
Parameters
Type | Name | Description |
---|---|---|
Location | location | The location object to which distance is to be calculated. |
Returns
Type | Description |
---|---|
System.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. |