Location
Namespace: Wisej.Hybrid.Shared.Geolocation
Assembly: Wisej.Hybrid
Represents a physical location with the latitude, longitude, altitude and time information reported by the device.
- C#
- VB.NET
public class Location
Public Class Location
Constructors
Location()
Initializes a new instance of the Location class.
Location(latitude, longitude)
Initializes a new instance of the Location class with the specified latitude and longitude.
| Name | Type | Description |
|---|---|---|
| latitude | Double | Default latitude for location. |
| longitude | Double | Default longitude for location. |
Location(latitude, longitude, timestamp)
Initializes a new instance of the Location class with the specified latitude, longitude, and timestamp.
| Name | Type | Description |
|---|---|---|
| latitude | Double | Default latitude for location. |
| longitude | Double | Default longitude for location. |
| timestamp | DateTimeOffset | UTC timestamp for the location. |
Location(latitude, longitude, altitude)
Initializes a new instance of the Location class with the specified latitude, longitude, and altitude.
| Name | Type | Description |
|---|---|---|
| latitude | Double | Default latitude for location. |
| longitude | Double | Default longitude for location. |
| altitude | Double | Default altitude for location. |
Location(point)
Initializes a new instance of the Location class from an existing instance.
| Name | Type | Description |
|---|---|---|
| point | Location | A Location instance that will be used to clone. |
Throws:
- ArgumentNullException Thrown if point is .
Properties
Accuracy
Nullable<Double>: Gets or sets the horizontal accuracy (in meters) of the location.
Altitude
Nullable<Double>: Gets the altitude in meters (if available) in a reference system which is specified by AltitudeReferenceSystem.
Returns 0 or if not available.
AltitudeReferenceSystem
AltitudeReferenceSystem: Specifies the reference system in which the Altitude value is expressed.
Course
Nullable<Double>: Gets or sets the current degrees relative to true north at the time when this location was determined.
Returns 0 or if not available.
IsFromMockProvider
Boolean: Gets or sets whether this location originates from a mocked sensor and thus might not be the real location of the device.
Latitude
Double: Gets or sets the latitude coordinate of this location.
Longitude
Double: Gets or sets the longitude coordinate of this location.
ReducedAccuracy
Boolean: Gets or sets whether this location has a reduced accuracy reading.
This functionality only applies to iOS. Other platforms will always report false.
Speed
Nullable<Double>: Gets or sets the current speed in meters per second at the time when this location was determined.
Returns 0 or if not available. Otherwise the value will range between 0-360. Requires Accuracy to be High or better.
Timestamp
DateTimeOffset: Gets or sets the timestamp of the location in UTC.
VerticalAccuracy
Nullable<Double>: Gets or sets the vertical accuracy (in meters) of the location.
Methods
CalculateDistance(latitudeStart, longitudeStart, locationEnd, units)
Calculate distance between two locations.
| Parameter | Type | Description |
|---|---|---|
| latitudeStart | Double | Latitude coordinate of the starting location. |
| longitudeStart | Double | Longitude coordinate of the starting location. |
| locationEnd | Location | The end location. |
| units | DistanceUnits | The unit in which the result distance is returned. |
Returns: Double. Distance between two locations in the unit selected.
CalculateDistance(locationStart, latitudeEnd, longitudeEnd, units)
Calculate distance between two locations.
| Parameter | Type | Description |
|---|---|---|
| locationStart | Location | The start location. |
| latitudeEnd | Double | Latitude coordinate of the end location. |
| longitudeEnd | Double | Longitude coordinate of the end location. |
| units | DistanceUnits | The unit in which the result distance is returned. |
Returns: Double. Distance between two locations in the unit selected.
CalculateDistance(locationStart, locationEnd, units)
Calculate distance between two locations.
| Parameter | Type | Description |
|---|---|---|
| locationStart | Location | The start location. |
| locationEnd | Location | The end location. |
| units | DistanceUnits | The unit in which the result distance is returned. |
Returns: Double. Distance between two locations in the unit selected.
CalculateDistance(latitudeStart, longitudeStart, latitudeEnd, longitudeEnd, units)
Calculate distance between two Location instances.
| Parameter | Type | Description |
|---|---|---|
| latitudeStart | Double | Latitude coordinate of the starting location. |
| longitudeStart | Double | Longitude coordinate of the starting location. |
| latitudeEnd | Double | Latitude coordinate of the end location. |
| longitudeEnd | Double | Longitude coordinate of the end location. |
| units | DistanceUnits | The unit in which the result distance is returned. |
Returns: Double. Distance between two locations in the unit selected.