From 1e9cf71b5ab243bf531ef8a1ed27dfcdaf75ca34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Thu, 22 Oct 2015 15:01:36 -0700 Subject: [PATCH] IB inspectable for allowing tilt --- include/mbgl/ios/MGLMapView+IBAdditions.h | 1 + platform/ios/MGLMapView.mm | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/mbgl/ios/MGLMapView+IBAdditions.h b/include/mbgl/ios/MGLMapView+IBAdditions.h index ce5019499..e7a602eac 100644 --- a/include/mbgl/ios/MGLMapView+IBAdditions.h +++ b/include/mbgl/ios/MGLMapView+IBAdditions.h @@ -34,6 +34,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic) IBInspectable BOOL allowsZooming; @property (nonatomic) IBInspectable BOOL allowsScrolling; @property (nonatomic) IBInspectable BOOL allowsRotating; +@property (nonatomic) IBInspectable BOOL allowsTilting; @property (nonatomic) IBInspectable BOOL showsUserLocation; @end diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 0e7547ef1..ce1ecfd6d 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -1535,7 +1535,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) + (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingPitchEnabled { - return [NSSet setWithObject:@"allowsPitching"]; + return [NSSet setWithObject:@"allowsTilting"]; } - (void)setDebugActive:(BOOL)debugActive @@ -3410,19 +3410,19 @@ class MBGLView : public mbgl::View self.rotateEnabled = allowsRotating; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingAllowsPitching ++ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingAllowsTilting { return [NSSet setWithObject:@"pitchEnabled"]; } -- (BOOL)allowsPitching +- (BOOL)allowsTilting { return self.pitchEnabled; } -- (void)setAllowsPitching:(BOOL)allowsPitching +- (void)setAllowsTilting:(BOOL)allowsTilting { - self.pitchEnabled = allowsPitching; + self.pitchEnabled = allowsTilting; } - (void)didReceiveMemoryWarning