Table of Contents

Class GeolocationCoordinates

Namespace
WebDriverBiDi.Emulation
Assembly
WebDriverBiDi.dll

A data class representing a set of geolocation coordinates.

public class GeolocationCoordinates
Inheritance
GeolocationCoordinates
Inherited Members

Constructors

GeolocationCoordinates(double, double)

Initializes a new instance of the GeolocationCoordinates class.

public GeolocationCoordinates(double latitude, double longitude)

Parameters

latitude double

The latitude of the geographic position in degrees. Positive values are north of the equator; negative values are south of the equator.

longitude double

The longitude of the geographic position in degrees. Positive values are east of the prime meridian; negative values are west of the prime meridian.

Properties

Accuracy

Gets or sets the accuracy of the geographic position to a 95% confidence level. If omitted, is interpreted as 1.0.

[JsonPropertyName("accuracy")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[SpecRange(0, Infinity)]
[JsonConverter(typeof(FixedDoubleJsonConverter))]
public double? Accuracy { get; set; }

Property Value

double?

Remarks

Valid values for this property are greater than or equal to 0.0. This property does not validate its value; a value outside this range is sent as-is, and a conforming remote end rejects it when the command is executed.

Altitude

Gets or sets the altitude of the geographic position, in meters.

[JsonPropertyName("altitude")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonConverter(typeof(FixedDoubleJsonConverter))]
public double? Altitude { get; set; }

Property Value

double?

AltitudeAccuracy

Gets or sets the accuracy of the altitude of the geographic position to a 95% confidence level.

[JsonPropertyName("altitudeAccuracy")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[SpecRange(0, Infinity)]
[JsonConverter(typeof(FixedDoubleJsonConverter))]
public double? AltitudeAccuracy { get; set; }

Property Value

double?

Remarks

Valid values for this property are greater than or equal to 0.0. The specification also requires that this property be set only when Altitude is also set: an altitude accuracy without an altitude is rejected as invalid argument. This property does not validate either constraint; the value is sent as-is, and a conforming remote end rejects it when the command is executed.

Heading

Gets or sets the heading of the movement of the geographic position, in degrees. If the device is stationary, leave this property unset (null).

[JsonPropertyName("heading")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[SpecRange(0, 360, MaximumExclusive = true)]
[JsonConverter(typeof(FixedDoubleJsonConverter))]
public double? Heading { get; set; }

Property Value

double?

Remarks

Valid values for this property range from 0.0 inclusive to 360.0 exclusive: the specification's CDDL range 0.0...360.0 excludes its upper bound, so 360.0 itself is not a valid heading (use 0.0). This property does not validate its value; a value outside this range is sent as-is, and a conforming remote end rejects it when the command is executed.

Latitude

Gets or sets the latitude of the geographic position in degrees. Positive values are north of the equator; negative values are south of the equator.

[JsonPropertyName("latitude")]
[SpecRange(-90, 90)]
[JsonConverter(typeof(FixedDoubleJsonConverter))]
public double Latitude { get; set; }

Property Value

double

Remarks

Valid values for this property range from -90.0 to 90.0, inclusive. This property does not validate its value; a value outside this range is sent as-is, and a conforming remote end rejects it when the command is executed.

Longitude

Gets or sets the longitude of the geographic position in degrees. Positive values are east of the prime meridian; negative values are west of the prime meridian.

[JsonPropertyName("longitude")]
[SpecRange(-180, 180)]
[JsonConverter(typeof(FixedDoubleJsonConverter))]
public double Longitude { get; set; }

Property Value

double

Remarks

Valid values for this property range from -180.0 to 180.0, inclusive. This property does not validate its value; a value outside this range is sent as-is, and a conforming remote end rejects it when the command is executed.

Speed

Gets or sets the speed of the movement of the geographic position, in meters per second. If the device is stationary, should be set to 0.

[JsonPropertyName("speed")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[SpecRange(0, Infinity)]
[JsonConverter(typeof(FixedDoubleJsonConverter))]
public double? Speed { get; set; }

Property Value

double?

Remarks

Valid values for this property are greater than or equal to 0.0. This property does not validate its value; a value outside this range is sent as-is, and a conforming remote end rejects it when the command is executed.