Skip to content

Commit

Permalink
fix(geolocate): geolocate always track the position
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-André Barbeau committed Oct 14, 2020
1 parent 91d85f5 commit 8368057
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/geo/src/lib/map/shared/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8368057

Please sign in to comment.