From 7e248bb8e5d20fe2a8acf3687b90d988c459c8dd Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 7 May 2020 14:34:13 +0200 Subject: [PATCH] Don't stop geolocation tracking on error --- changelog/upgrade-notes.md | 14 ++++++++++++++ src/ol/Geolocation.js | 1 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index 6ade599999..e269e77ae8 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -1,5 +1,19 @@ ## Upgrade notes +### v6.3.2 + +#### Backwards incompatible changes + +##### Geolocation no longer stop tracking after an error + +Previously, when the Geolocation class encounter an error the tracking was stopped. It now continues to track. +To get the previous behavior, use the following code: +```js +geolocation.on('error', function (error) { + geolocation.setTracking(false); +}); +``` + ### v6.3.0 #### Vector source loading when extent crosses +/-180 diff --git a/src/ol/Geolocation.js b/src/ol/Geolocation.js index 1ded94d821..26f76d2296 100644 --- a/src/ol/Geolocation.js +++ b/src/ol/Geolocation.js @@ -213,7 +213,6 @@ class Geolocation extends BaseObject { * @param {PositionError} error error object. */ positionError_(error) { - this.setTracking(false); this.dispatchEvent(new GeolocationError(error)); }