GeolocationReading Class

A position of the device returned by a GeolocationProvider (https://w3c.github.io/geolocation/#coordinates-interface).

public sealed class GeolocationReading

Constructors

NameDescription
GeolocationReading(double, double, double)Creates a position.

GeolocationReading(double, double, double)

GeolocationProvider.cs

Creates a position.

public GeolocationReading(double latitude, double longitude, double accuracy)

Parameters

latitude double
The latitude, in decimal degrees.
longitude double
The longitude, in decimal degrees.
accuracy double
The accuracy of the latitude and the longitude, in meters (a non-negative number).

Properties

NameDescription
AccuracyGets the accuracy of the latitude and the longitude, in meters.
AltitudeGets the height above the WGS84 ellipsoid, in meters, or null when it is unknown.
AltitudeAccuracyGets the accuracy of GeolocationReading.Altitude, in meters, or null when it is unknown.
HeadingGets the direction of travel, in degrees clockwise from the true north, or null when it is unknown (it is ignored when GeolocationReading.Speed is 0).
LatitudeGets the latitude, in decimal degrees.
LongitudeGets the longitude, in decimal degrees.
SpeedGets the horizontal speed, in meters per second, or null when it is unknown.

Gets the accuracy of the latitude and the longitude, in meters.

public double Accuracy { get; }

Property value

double

Gets the height above the WGS84 ellipsoid, in meters, or null when it is unknown.

public double? Altitude { get; init; }

Property value

double?

AltitudeAccuracy

GeolocationProvider.cs

Gets the accuracy of GeolocationReading.Altitude, in meters, or null when it is unknown.

public double? AltitudeAccuracy { get; init; }

Property value

double?

Gets the direction of travel, in degrees clockwise from the true north, or null when it is unknown (it is ignored when GeolocationReading.Speed is 0).

public double? Heading { get; init; }

Property value

double?

Gets the latitude, in decimal degrees.

public double Latitude { get; }

Property value

double

Gets the longitude, in decimal degrees.

public double Longitude { get; }

Property value

double

Gets the horizontal speed, in meters per second, or null when it is unknown.

public double? Speed { get; init; }

Property value

double?