From cb1309a253b7a9dd203817510a56cee0f0157889 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Wed, 6 Sep 2017 15:10:46 -0400 Subject: [ios] Implicitly enable showsUserLocation when enabling the heading indicator --- platform/ios/src/MGLMapView.h | 4 ++-- platform/ios/src/MGLMapView.mm | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index 16a76ebcfe..33d1146943 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -362,8 +362,8 @@ MGL_EXPORT IB_DESIGNABLE permanent heading indicator. Setting this property to `YES` causes the default user location annotation to - always show an arrow-shaped heading indicator, if heading is available. This - property does not rotate the map; for that, see + appear and always show an arrow-shaped heading indicator, if heading is + available. This property does not rotate the map; for that, see `MGLUserTrackingModeFollowWithHeading`. This property has no effect when `userTrackingMode` is diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index e6d10f3479..7d47da694c 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -4416,6 +4416,12 @@ public: - (void)setShowsUserHeadingIndicator:(BOOL)showsUserHeadingIndicator { _showsUserHeadingIndicator = showsUserHeadingIndicator; + + if (_showsUserHeadingIndicator) + { + self.showsUserLocation = YES; + } + [self validateUserHeadingUpdating]; } @@ -4423,7 +4429,7 @@ public: { BOOL canShowPermanentHeadingIndicator = self.showsUserHeadingIndicator && self.userTrackingMode != MGLUserTrackingModeFollowWithCourse; - if (self.showsUserLocation && (canShowPermanentHeadingIndicator || self.userTrackingMode == MGLUserTrackingModeFollowWithHeading)) + if (canShowPermanentHeadingIndicator || self.userTrackingMode == MGLUserTrackingModeFollowWithHeading) { [self updateHeadingForDeviceOrientation]; [self.locationManager startUpdatingHeading]; -- cgit v1.2.1