Class GeolocationCoordinates
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The GeolocationCoordinates interface represents the position and altitude of the device on Earth, as well as the accuracy with which these properties are calculated.
The geographic position information is provided in terms of World Geodetic System coordinates (WGS84).
[Value("GeolocationCoordinates")]
public class GeolocationCoordinates
- Inheritance
-
GeolocationCoordinates
- Inherited Members
Remarks
Constructors
GeolocationCoordinates()
public GeolocationCoordinates()
Properties
Accuracy
The accuracy read-only property of the GeolocationCoordinates interface is a strictly positive double representing the accuracy, with a 95% confidence level, of the Latitude and Longitude properties expressed in meters.
[Value("accuracy")]
public Number Accuracy { get; }
Property Value
- Number
A positive
doublerepresenting the accuracy, with a 95% confidence level,
of the Latitude and
Longitude properties expressed in meters.
Remarks
Altitude
The altitude read-only property of the GeolocationCoordinates interface is a double representing the altitude of the position in meters above the WGS84 ellipsoid (which defines the nominal sea level surface). This value is null if the implementation cannot provide this data.
[Value("altitude")]
public Number? Altitude { get; }
Property Value
Remarks
-Using the Geolocation API
-The GeolocationCoordinates interface it belongs to.
-National Imagery and Mapping Agency Technical Report 8350.2, Third Edition (WGS84)
AltitudeAccuracy
The altitudeAccuracy read-only property of the GeolocationCoordinates interface is a strictly positive double representing the accuracy, with a 95% confidence level, of the altitude expressed in meters. This value is null if the implementation doesn't support measuring altitude.
[Value("altitudeAccuracy")]
public Number? AltitudeAccuracy { get; }
Property Value
- Number
A positive
doublerepresenting the accuracy, with a 95% confidence level,
of thealtitudeexpressed in meters.
Remarks
Heading
The heading read-only property of the GeolocationCoordinates interface is a double representing the direction in which the device is traveling. This value, specified in degrees, indicates how far off from heading due north the device is. 0 degrees represents true north, and the direction is determined clockwise (which means that east is 90 degrees and west is 270 degrees). If Speed is 0 or the device is not able to provide heading information, heading is null.
[Value("heading")]
public Number? Heading { get; }
Property Value
- Number
A
doublerepresenting the direction in which the device is traveling.
Remarks
Latitude
The latitude read-only property of the GeolocationCoordinates interface is a double representing the latitude of the position in decimal degrees.
[Value("latitude")]
public Number Latitude { get; }
Property Value
- Number
A
doublerepresenting the latitude of the position in decimal degrees.
Remarks
Longitude
The longitude read-only property of the GeolocationCoordinates interface is a number which represents the longitude of a geographical position, specified in decimal degrees.
Together with a timestamp, given as Unix time in milliseconds, indicating a time of measurement, the GeolocationCoordinates object is part of the GeolocationPosition interface, which is the object type returned by Geolocation API functions that obtain and return a geographical position.
[Value("longitude")]
public Number Longitude { get; }
Property Value
- Number
The value in
longitudeis the geographical longitude of the location on
Earth described by theCoordinatesobject, in decimal degrees. The value is
defined by the World Geodetic System 1984 specification (WGS 84).NOTE
The zero meridian (also known as the prime meridian or the
reference meridian) is not precisely the same as the Greenwich meridian that most
people think of. It is, instead, the IERS Reference Meridian, which is located 5.3 arcseconds (102
meters / 335 feet) east of the Greenwich meridian. This
is the same standard used by the Global Positioning System (GPS).
Remarks
-Using the Geolocation API
-The GeolocationCoordinates interface it belongs to.
-The GeolocationPosition interface, which is the top-level interface
used to return geolocation data from the Geolocation API functions
GetCurrentPosition(PositionCallback, PositionErrorCallback?, PositionOptions) and
WatchPosition(PositionCallback, PositionErrorCallback?, PositionOptions).
Speed
The speed read-only property of the GeolocationCoordinates interface is a double representing the velocity of the device in meters per second. This value is null if the implementation is not able to measure it.
[Value("speed")]
public Number? Speed { get; }
Property Value
- Number
A
doublerepresenting the velocity of the device in meters per second.
Remarks
Methods
ToJSON()
The toJSON() method of the GeolocationCoordinates interface is a {{Glossary("Serialization","serializer")}}; it returns a JSON representation of the GeolocationCoordinates object.
[Value("toJSON")]
public Object ToJSON()
Returns
- Object
A {{jsxref("JSON")}} object that is the serialization of the GeolocationCoordinates object.