From 0b1e7c2cdd82750b1370a74872212050871c9438 Mon Sep 17 00:00:00 2001 From: Dave Prukop Date: Wed, 1 Aug 2018 16:06:53 -0700 Subject: Moved cameraAltitudeAffectedByPitch to private API. Changelog updated --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLMapView.h | 12 ------------ platform/ios/src/MGLMapView.mm | 3 +++ platform/macos/CHANGELOG.md | 4 ++++ platform/macos/src/MGLMapView.h | 9 +++++++++ platform/macos/src/MGLMapView.mm | 5 +++++ 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 1e606702c3..7fc73d084c 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -16,6 +16,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Fixed a crash when switching between two styles having layers with the same identifier but different layer types. ([#12432](https://github.com/mapbox/mapbox-gl-native/issues/12432)) * Fixed an issue where the symbols for `MGLMapPointForCoordinate` could not be found. ([#12445](https://github.com/mapbox/mapbox-gl-native/issues/12445)) * Fixed an issue causing country and ocean labels to disappear after calling `-[MGLStyle localizeLabelsIntoLocale:]` when the system language is set to Simplified Chinese. ([#12164](https://github.com/mapbox/mapbox-gl-native/issues/12164)) +* Added a new method `-[MGLMapView setCamera:edgePadding:]` that sets the camera with arbitrary insets. ([#12518](https://github.com/mapbox/mapbox-gl-native/pull/12518)) ## 4.2.0 - July 18, 2018 diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index b61e748e23..309eff56fe 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -555,18 +555,6 @@ MGL_EXPORT IB_DESIGNABLE */ @property(nonatomic, getter=isHapticFeedbackEnabled) BOOL hapticFeedbackEnabled; -/** - A Boolean value that determines whether the updating pitch will also affect the altitude. - - When this property is set to `NO`, pitch will work independently from altitude. - The default value of this property is YES. - - Setting this property to NO will allow animation libraries outside of this SDK to control the - map camera without the built-in side effect that pitch influences altitude. This will make the - results of using outside animation more predictable and easier to control. - */ -@property(nonatomic, getter=isCameraAltitudeAffectedByPitch) BOOL cameraAltitudeAffectedByPitch; - /** A floating-point value that determines the rate of deceleration after the user lifts their finger. diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 297c87961f..a423053c1e 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -240,6 +240,9 @@ public: @property (nonatomic) MGLUserLocation *userLocation; @property (nonatomic) NSMutableDictionary *> *annotationViewReuseQueueByIdentifier; +/// A Boolean value that determines whether the updating pitch will also affect the altitude. +@property(nonatomic, getter=isCameraAltitudeAffectedByPitch) BOOL cameraAltitudeAffectedByPitch; + @end @implementation MGLMapView diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 001b3792d5..7b55c8d972 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -7,6 +7,10 @@ * Token string syntax (`"{token}"`) in `MGLSymbolStyleLayer` `text` and `iconImageName` properties is now correctly converted to the appropriate `NSExpression` equivalent. ([#11659](https://github.com/mapbox/mapbox-gl-native/issues/11659)) * Fixed a crash when switching between two styles having layers with the same identifier but different layer types. ([#12432](https://github.com/mapbox/mapbox-gl-native/issues/12432)) +## Other changes + +* Added a new method `-[MGLMapView setCamera:edgePadding:]` that sets the camera with arbitrary insets. ([#12518](https://github.com/mapbox/mapbox-gl-native/pull/12518)) + # 0.9.0 - July 18, 2018 ## Styles and rendering diff --git a/platform/macos/src/MGLMapView.h b/platform/macos/src/MGLMapView.h index 305a1348e4..28097f93fd 100644 --- a/platform/macos/src/MGLMapView.h +++ b/platform/macos/src/MGLMapView.h @@ -308,6 +308,15 @@ MGL_EXPORT IB_DESIGNABLE */ - (void)setCamera:(MGLMapCamera *)camera animated:(BOOL)animated; +/** + Moves the viewpoint to a different location without using a transition. + + @param camera The new viewpoint. + @param edgePadding The minimum padding (in screen points) that would be visible + + */ +- (void)setCamera:(MGLMapCamera *)camera edgePadding:(NSEdgeInsets)edgePadding; + /** Moves the viewpoint to a different location with respect to the map with an optional transition duration and timing function. diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 154b716377..a9ad4831c3 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -1124,6 +1124,11 @@ public: [self setCamera:camera withDuration:animated ? MGLAnimationDuration : 0 animationTimingFunction:nil completionHandler:NULL]; } +- (void)setCamera:(MGLMapCamera *)camera edgePadding:(NSEdgeInsets)edgePadding +{ + [self setCamera:camera withDuration:0 animationTimingFunction:nil edgePadding:edgePadding completionHandler:nil]; +} + - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion { [self setCamera:camera withDuration:duration animationTimingFunction:function edgePadding:self.contentInsets completionHandler:completion]; } -- cgit v1.2.1