new Geolocation(opt_options)
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Options.
|
Fires:
-
error
- Triggered when the Geolocation returns an error.
Methods
-
getAccuracy(){number|undefined}
Geolocation.js, line 189 -
Get the accuracy of the position in meters.
Returns:
The accuracy of the position measurement in meters.
-
Get a geometry of the position accuracy.
Returns:
A geometry of the position accuracy.
-
getAltitude(){number|undefined}
Geolocation.js, line 212 -
Get the altitude associated with the position.
Returns:
The altitude of the position in meters above mean sea level.
-
getAltitudeAccuracy(){number|undefined}
Geolocation.js, line 223 -
Get the altitude accuracy of the position.
Returns:
The accuracy of the altitude measurement in meters.
-
getHeading(){number|undefined}
Geolocation.js, line 235 -
Get the heading as radians clockwise from North. Note: depending on the browser, the heading is only defined if the
enableHighAccuracy
is set totrue
in the tracking options.Returns:
The heading of the device in radians from north.
-
Get the position of the device.
Returns:
The current position of the device reported in the current projection.
-
Get the projection associated with the position.
Returns:
The projection the position is reported in.
-
getSpeed(){number|undefined}
Geolocation.js, line 272 -
Get the speed in meters per second.
Returns:
The instantaneous speed of the device in meters per second.
-
getTracking(){boolean}
Geolocation.js, line 282 -
Determine if the device location is being tracked.
Returns:
The device location is being tracked.
-
getTrackingOptions(){PositionOptions|undefined}
Geolocation.js, line 295 -
Get the tracking options. See http://www.w3.org/TR/geolocation-API/#position-options.
Returns:
PositionOptions as defined by the HTML5 Geolocation spec .
-
setProjection(projection)
Geolocation.js, line 306 -
Set the projection to use for transforming the coordinates.
Name Type Description projection
module:ol/proj~ProjectionLike The projection the position is reported in.
-
setTracking(tracking)
Geolocation.js, line 316 -
Enable or disable tracking.
Name Type Description tracking
boolean Enable tracking.
-
setTrackingOptions(options)
Geolocation.js, line 329 -
Set the tracking options. See http://www.w3.org/TR/geolocation-API/#position-options.
Name Type Description options
PositionOptions PositionOptions as defined by the HTML5 Geolocation spec .