Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios] Fix the user location not getting displayed when setting tracki…
Browse files Browse the repository at this point in the history
…ng mode to followWithCourse and followWithHeading (#13849)

Removed legacy code that was causing the mapView to ignore setting the user location to tracking modes follingWithCourse and followWithHeading.
  • Loading branch information
fabian-guerra committed Feb 1, 2019
1 parent b07db0f commit d7f71a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 4 additions & 0 deletions platform/ios/CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started.

## master

* Fixed a bug where setting `MGLMapView.userTrackingMode` to `MGLUserTrackingModeFollowWithHeading` and `MGLUserTrackingModeFollowWithCourse` was being ignored. ([#13849](https://github.com/mapbox/mapbox-gl-native/pull/13849))

## 4.8.0

### Styles and rendering
Expand Down
6 changes: 0 additions & 6 deletions platform/ios/src/MGLMapView.mm
Expand Up @@ -5163,12 +5163,6 @@ - (void)setUserTrackingMode:(MGLUserTrackingMode)mode animated:(BOOL)animated
MGLLogDebug(@"Setting userTrackingMode: %lu animated: %@", mode, MGLStringFromBOOL(animated));
if (mode == _userTrackingMode) return;

if ((mode == MGLUserTrackingModeFollowWithHeading || mode == MGLUserTrackingModeFollowWithCourse) &&
! CLLocationCoordinate2DIsValid(self.userLocation.coordinate))
{
mode = MGLUserTrackingModeNone;
}

MGLUserTrackingMode oldMode = _userTrackingMode;
[self willChangeValueForKey:@"userTrackingMode"];
_userTrackingMode = mode;
Expand Down

0 comments on commit d7f71a2

Please sign in to comment.