diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index d0704a41c6a..f847c0d5468 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -73,8 +73,8 @@ IB_DESIGNABLE * The default value of this property is `YES`. */ @property(nonatomic, getter=isRotateEnabled) BOOL rotateEnabled; -/** The compass image view shown in the upper-right when the map is rotated. */ -@property (nonatomic, readonly) UIImageView *compassView; +/** The compass button shown in the upper-right when the map is rotated. */ +@property (nonatomic, readonly) UIButton *compassButton; /** The Mapbox logo image view shown in the lower-left of the map. */ @property (nonatomic, readonly) UIImageView *logoView; diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 06a2ef36be8..3e59117600b 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -69,7 +69,7 @@ @interface MGLMapView () = 360) degrees -= 360; while (degrees < 0) degrees += 360; - self.compassView.transform = CGAffineTransformMakeRotation(MGLRadiansFromDegrees(degrees)); + self.compassButton.transform = CGAffineTransformMakeRotation(MGLRadiansFromDegrees(degrees)); - if (_mbglMap->getBearing() && self.compassView.alpha < 1) + if (_mbglMap->getBearing() && self.compassButton.alpha < 1) { [UIView animateWithDuration:MGLAnimationDuration delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^ { - self.compassView.alpha = 1; + self.compassButton.alpha = 1; } completion:nil]; } - else if (_mbglMap->getBearing() == 0 && self.compassView.alpha > 0) + else if (_mbglMap->getBearing() == 0 && self.compassButton.alpha > 0) { [UIView animateWithDuration:MGLAnimationDuration delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^ { - self.compassView.alpha = 0; + self.compassButton.alpha = 0; } completion:nil]; }