From d7f71a2399fb9d988ded1e3cdf0e1fd80be83d54 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Fri, 1 Feb 2019 11:59:26 -0800 Subject: [ios] Fix the user location not getting displayed when setting tracking 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. --- platform/ios/CHANGELOG.md | 4 ++++ platform/ios/src/MGLMapView.mm | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 7974598ce8..61ecc4f5e7 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -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 diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 309584e73a..9620a9514c 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -5163,12 +5163,6 @@ public: 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; -- cgit v1.2.1