Merge pull request #7743 from fredj/enableHighAccuracy

Set enableHighAccuracy in geolocation example
This commit is contained in:
Frédéric Junod
2018-01-26 12:24:24 +01:00
committed by GitHub
2 changed files with 6 additions and 0 deletions

View File

@@ -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()
});

View File

@@ -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