summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2017-09-06 15:10:46 -0400
committerJason Wray <jason@mapbox.com>2017-09-07 19:23:30 -0400
commitcb1309a253b7a9dd203817510a56cee0f0157889 (patch)
tree0fa1ad6c9556f159f60488b26ab3af3078390de6
parent63250baa4e73516f300e84ddbc882fc8d41276ef (diff)
downloadqtlocation-mapboxgl-cb1309a253b7a9dd203817510a56cee0f0157889.tar.gz
[ios] Implicitly enable showsUserLocation when enabling the heading indicator
-rw-r--r--platform/ios/src/MGLMapView.h4
-rw-r--r--platform/ios/src/MGLMapView.mm8
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];