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.
public class Location
- Inheritance
-
Location
Constructors
View SourceLocation()
The default constructor of the Location class.
Declaration
public Location()
API Level: 3
View SourceLocation(Double, Double, Double, Double, Double, Double, Int32)
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. |
Int32 | timestamp | Time when the measurement took place. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when an invalid argument is used. |
API Level: 3
Properties
View SourceAccuracy
The accuracy.
Declaration
public double Accuracy { get; set; }
Property Value
Type | Description |
---|---|
Double |
API Level: 3
View SourceAltitude
The current altitude (meters).
Declaration
public double Altitude { get; set; }
Property Value
Type | Description |
---|---|
Double |
API Level: 3
View SourceDirection
The direction and degrees from the north.
Declaration
public double Direction { get; set; }
Property Value
Type | Description |
---|---|
Double |
API Level: 3
View SourceLatitude
The current latitude [-90.0 ~ 90.0] (degrees).
Declaration
public double Latitude { get; set; }
Property Value
Type | Description |
---|---|
Double |
API Level: 3
View SourceLongitude
The current longitude [-180.0 ~ 180.0] (degrees).
Declaration
public double Longitude { get; set; }
Property Value
Type | Description |
---|---|
Double |
API Level: 3
View SourceSpeed
The device speed (km/h).
Declaration
public double Speed { get; set; }
Property Value
Type | Description |
---|---|
Double |
API Level: 3
View SourceTimestamp
The time value when the measurement was done.
Declaration
public DateTime Timestamp { get; }
Property Value
Type | Description |
---|---|
DateTime |
API Level: 3
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 |
---|---|
ArgumentException | Thrown when an invalid argument is used. |
NotSupportedException | Thrown when the location is not supported. |
API Level: 3
View SourceGetDistanceTo(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 |
---|---|
ArgumentException | Thrown when an invalid argument is used. |
NotSupportedException | Thrown when the location is not supported. |