You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plumbed camera options all the way through to MGLMapView. Added a method that lets you specify a direction in addition to center point and zoom level.
Added Map::jumpTo() for parity with mapbox-gl-js. Replaced usage of Map::setLatLng() and Map::setLatLngZoom() with Map::jumpTo() or Map::easeTo() within MGLMapView. Replaced MGLMapView.pitch with MGLMapCamera for setting all supported degrees of freedom simultaneously. Simultaneously move and rotate with course.
Support customizable timing functions on iOS.
iosapp now persists an archived MGLMapCamera instead of separate viewpoint properties and also synchronizes user defaults on termination. This change implements persistence entirely in Objective-C, eliminating the use of the Objective-C++ implementation.
Fixesmapbox#1643, fixesmapbox#1834. Ref mapbox#1581.
Copy file name to clipboardexpand all lines: include/mbgl/ios/MGLMapView.h
+15-11
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,13 @@
1
1
#import"MGLGeometry.h"
2
+
#import"MGLMapCamera.h"
2
3
3
4
#import<UIKit/UIKit.h>
4
5
#import<CoreLocation/CoreLocation.h>
5
6
6
7
NS_ASSUME_NONNULL_BEGIN
7
8
8
9
@class MGLAnnotationImage;
10
+
@class MGLMapCamera;
9
11
@class MGLUserLocation;
10
12
@class MGLPolyline;
11
13
@class MGLPolygon;
@@ -136,6 +138,8 @@ IB_DESIGNABLE
136
138
* @param animated Specify `YES` if you want the map view to animate scrolling and zooming to the new location or `NO` if you want the map to display the new location immediately. */
/** The coordinate bounds visible in the receiver’s viewport.
140
144
*
141
145
* Changing the value of this property updates the receiver immediately. If you want to animate the change, call `setVisibleCoordinateBounds:animated:` instead. */
@@ -181,19 +185,19 @@ IB_DESIGNABLE
181
185
/** Resets the map rotation to a northern heading. */
182
186
- (IBAction)resetNorth;
183
187
184
-
/** The pitch of the map (measured in degrees).
185
-
*
186
-
* The default value `0` shows a completely flat map. Maximum value is `60`. */
187
-
@property (nonatomic) double pitch;
188
+
/** A camera representing the current viewpoint of the map. */
189
+
@property (nonatomic, copy) MGLMapCamera *camera;
188
190
189
-
/** Changes the pitch of the map.
190
-
* @param pitch The pitch of the map (measured in degrees) relative to top-down.
191
-
*
192
-
* Changing the pitch tilts the map without changing the current center coordinate or zoom level. */
193
-
- (void)setPitch:(double)pitch;
191
+
/** Moves the viewpoint to a different location with respect to the map with an optional transition animation.
192
+
* @param camera The new viewpoint.
193
+
* @param animated Specify `YES` if you want the map view to animate the change to the new viewpoint or `NO` if you want the map to display the new viewpoint immediately. */
/** Moves the viewpoint to a different location with respect to the map with an optional transition duration and timing function.
197
+
* @param camera The new viewpoint.
198
+
* @param duration The amount of time, measured in seconds, that the transition animation should take. Specify `0` to jump to the new viewpoint instantaneously.
199
+
* @param function A timing function used for the animation. Set this parameter to `nil` for a transition that matches most system animations. If the duration is `0`, this parameter is ignored. */
0 commit comments