diff options
author | Jason Wray <jason@kulturny.com> | 2015-08-18 16:25:40 -0400 |
---|---|---|
committer | Jason Wray <jason@kulturny.com> | 2015-08-26 11:23:03 -0700 |
commit | 42dc5336db5179c50b8d1edeca0bef7a27c8cefd (patch) | |
tree | 601c4117661e9aaed3ffd17660946476cf7eb238 /include | |
parent | d8ed33c7d48dbabe7e6f5e48f148ea2bec823a07 (diff) | |
download | qtlocation-mapboxgl-42dc5336db5179c50b8d1edeca0bef7a27c8cefd.tar.gz |
iOS perspective gesture support
Drag two fingers upward to tilt the map.
Implements #2116
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/ios/MGLMapView.h | 21 | ||||
-rw-r--r-- | include/mbgl/platform/darwin/settings_nsuserdefaults.hpp | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index 2b9a3d2913..fc70f3d904 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -74,6 +74,13 @@ IB_DESIGNABLE * The default value of this property is `YES`. */ @property(nonatomic, getter=isRotateEnabled) BOOL rotateEnabled; +/** A Boolean value that determines whether the user may change the pitch (tilt) of the map. + * + * This property controls only user interactions with the map. If you set the value of this property to `NO`, you may still change the pitch of the map programmatically. + * + * The default value of this property is `YES`. */ +@property(nonatomic, getter=isPitchEnabled) BOOL pitchEnabled; + /** The compass image view shown in the upper-right when the map is rotated. */ @property (nonatomic, readonly) UIImageView *compassView; @@ -173,6 +180,20 @@ IB_DESIGNABLE /** Resets the map rotation to a northern heading. */ - (IBAction)resetNorth; +/** The pitch of the map (measured in degrees). + * + * The default value `0` shows a completely flat map. Maximum value is `60`. */ +@property (nonatomic) double pitch; + +/** Changes the pitch of the map. + * @param pitch The pitch of the map (measured in degrees) relative to top-down. + * + * Changing the pitch tilts the map without changing the current center coordinate or zoom level. */ +- (void)setPitch:(double)pitch; + +/** Resets the map pitch to head-on. */ +- (IBAction)resetPitch; + #pragma mark - Converting Map Coordinates /** @name Converting Map Coordinates */ diff --git a/include/mbgl/platform/darwin/settings_nsuserdefaults.hpp b/include/mbgl/platform/darwin/settings_nsuserdefaults.hpp index 6c91fd3029..615320ee55 100644 --- a/include/mbgl/platform/darwin/settings_nsuserdefaults.hpp +++ b/include/mbgl/platform/darwin/settings_nsuserdefaults.hpp @@ -17,6 +17,7 @@ public: double latitude = 0; double zoom = 0; double bearing = 0; + double pitch = 0; MGLUserTrackingMode userTrackingMode = MGLUserTrackingModeNone; bool showsUserLocation = false; |