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({
|
const geolocation = new Geolocation({
|
||||||
|
// enableHighAccuracy must be set to true to have the heading value.
|
||||||
|
trackingOptions: {
|
||||||
|
enableHighAccuracy: true
|
||||||
|
},
|
||||||
projection: view.getProjection()
|
projection: view.getProjection()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -246,6 +246,8 @@ Geolocation.prototype.getAltitudeAccuracy = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the heading as radians clockwise from North.
|
* 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.
|
* @return {number|undefined} The heading of the device in radians from north.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
Reference in New Issue
Block a user