From 8368057602b92bbdb391e0b1cc96dddc84f8de7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Barbeau?= Date: Wed, 14 Oct 2020 13:30:38 -0400 Subject: [PATCH] fix(geolocate): geolocate always track the position --- packages/geo/src/lib/map/shared/map.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/geo/src/lib/map/shared/map.ts b/packages/geo/src/lib/map/shared/map.ts index 038be14d7d..1cac12795c 100644 --- a/packages/geo/src/lib/map/shared/map.ts +++ b/packages/geo/src/lib/map/shared/map.ts @@ -451,15 +451,10 @@ export class IgoMap { this.geolocationFeature = new olFeature({ geometry }); this.geolocationFeature.setId('geolocationFeature'); - if (!this.positionFollower && this.alwaysTracking) { + if (this.alwaysTracking) { this.overlay.addOlFeature( this.geolocationFeature, - FeatureMotion.None - ); - } else if (this.positionFollower && this.alwaysTracking) { - this.overlay.addOlFeature( - this.geolocationFeature, - FeatureMotion.Move + this.positionFollower ? FeatureMotion.Move : FeatureMotion.None ); } else { this.overlay.addOlFeature(this.geolocationFeature); @@ -496,7 +491,7 @@ export class IgoMap { view.setCenter(coordinates); view.setZoom(14); } - if (track && !this.alwaysTracking) { + if (track !== true && this.alwaysTracking !== true) { this.unsubscribeGeolocate(); } first = false;