Merge pull request #7743 from fredj/enableHighAccuracy
Set enableHighAccuracy in geolocation example
This commit is contained in:
@@ -34,6 +34,10 @@ const map = new Map({
|
||||
});
|
||||
|
||||
const geolocation = new Geolocation({
|
||||
// enableHighAccuracy must be set to true to have the heading value.
|
||||
trackingOptions: {
|
||||
enableHighAccuracy: true
|
||||
},
|
||||
projection: view.getProjection()
|
||||
});
|
||||
|
||||
|
||||
@@ -246,6 +246,8 @@ Geolocation.prototype.getAltitudeAccuracy = function() {
|
||||
|
||||
/**
|
||||
* Get the heading as radians clockwise from North.
|
||||
* Note: depending on the browser, the heading is only defined if the `enableHighAccuracy`
|
||||
* is set to `true` in the tracking options.
|
||||
* @return {number|undefined} The heading of the device in radians from north.
|
||||
* @observable
|
||||
* @api
|
||||
|
||||
Reference in New Issue
Block a user