From 76ca360882fcdc1b5917af512520f48969992b2d Mon Sep 17 00:00:00 2001 From: Julian Rex Date: Thu, 15 Nov 2018 16:58:12 -0500 Subject: Updated comments for clarity. Moved MGLUnderlyingMapUnavailableException into private header. --- platform/ios/app/MBXViewController.m | 2 +- platform/ios/src/MGLMapView.h | 19 +++++++++---------- platform/ios/src/MGLMapView.mm | 6 +++--- platform/ios/src/MGLMapView_Private.h | 3 +++ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index dff484b29f..34bb43fc40 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -1986,7 +1986,7 @@ CLLocationCoordinate2D randomWorldCoordinate() { annotationView.backgroundColor = [UIColor whiteColor]; // Note that having two long press gesture recognizers on overlapping - // views (`self.view` & `annotationView`) will cause weird behaviour. + // views (`self.view` & `annotationView`) will cause weird behavior. // Comment out the pin dropping functionality in the handleLongPress: // method in this class to make draggable annotation views play nice. annotationView.draggable = YES; diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index 82d1b2df84..fd433fe1b3 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -103,7 +103,6 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLMapViewPreferredFramesPerSecond MGLMapView FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLMissingLocationServicesUsageDescriptionException; FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLUserLocationAnnotationTypeException; FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLResourceNotFoundException; -FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLUnderlyingMapUnavailableException; /** An interactive, customizable map view with an interface similar to the one @@ -643,7 +642,7 @@ MGL_EXPORT IB_DESIGNABLE location or `NO` if you want the map to display the new location immediately. - @note The behaviour of this method is undefined if called when observing + @note The behavior of this method is undefined if called in response to `UIApplicationWillTerminateNotification`. */ - (void)setCenterCoordinate:(CLLocationCoordinate2D)coordinate animated:(BOOL)animated; @@ -658,7 +657,7 @@ MGL_EXPORT IB_DESIGNABLE zooming to the new location or `NO` if you want the map to display the new location immediately. - @note The behaviour of this method is undefined if called when observing + @note The behavior of this method is undefined if called in response to `UIApplicationWillTerminateNotification`. */ - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel animated:(BOOL)animated; @@ -675,7 +674,7 @@ MGL_EXPORT IB_DESIGNABLE zooming, and rotating to the new location or `NO` if you want the map to display the new location immediately. - @note The behaviour of this method is undefined if called when observing + @note The behavior of this method is undefined if called in response to `UIApplicationWillTerminateNotification`. */ - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel direction:(CLLocationDirection)direction animated:(BOOL)animated; @@ -693,7 +692,7 @@ MGL_EXPORT IB_DESIGNABLE display the new location immediately. @param completion The block executed after the animation finishes. - @note The behaviour of this method is undefined if called when observing + @note The behavior of this method is undefined if called in response to `UIApplicationWillTerminateNotification`. */ - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel direction:(CLLocationDirection)direction animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion; @@ -1034,7 +1033,7 @@ MGL_EXPORT IB_DESIGNABLE including the entire coordinate bounds. The camera object uses the current direction and pitch. - @note The behaviour of this method is undefined if called when observing + @note The behavior of this method is undefined if called in response to `UIApplicationWillTerminateNotification`; you may receive a `nil` return value depending on the order of notification delivery. */ @@ -1052,7 +1051,7 @@ MGL_EXPORT IB_DESIGNABLE including the entire coordinate bounds. The camera object uses the current direction and pitch. - @note The behaviour of this method is undefined if called when observing + @note The behavior of this method is undefined if called in response to `UIApplicationWillTerminateNotification`; you may receive a `nil` return value depending on the order of notification delivery. */ @@ -1072,7 +1071,7 @@ MGL_EXPORT IB_DESIGNABLE including the entire coordinate bounds. The initial camera's pitch and direction will be honored. - @note The behaviour of this method is undefined if called when observing + @note The behavior of this method is undefined if called in response to `UIApplicationWillTerminateNotification`; you may receive a `nil` return value depending on the order of notification delivery. */ @@ -1091,7 +1090,7 @@ MGL_EXPORT IB_DESIGNABLE (close to the ground) as possible while still including the entire shape. The initial camera's pitch and direction will be honored. - @note The behaviour of this method is undefined if called when observing + @note The behavior of this method is undefined if called in response to `UIApplicationWillTerminateNotification`; you may receive a `nil` return value depending on the order of notification delivery. */ @@ -1109,7 +1108,7 @@ MGL_EXPORT IB_DESIGNABLE (close to the ground) as possible while still including the entire shape. The camera object uses the current pitch. - @note The behaviour of this method is undefined if called when observing + @note The behavior of this method is undefined if called in response to `UIApplicationWillTerminateNotification`; you may receive a `nil` return value depending on the order of notification delivery. */ diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 9d640dd6d3..7b4c9f2eb3 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -2377,7 +2377,7 @@ public: - (MGLMapDebugMaskOptions)debugMask { - if (!self.terminated) + if (self.terminated) { return self.residualDebugMask; } @@ -3437,9 +3437,9 @@ public: - (MGLMapCamera *)camera { - if (!_mbglMap) + if (self.terminated) { - return [self valueAtTerminationForKey:@"camera" ofClass:[MGLMapCamera class]]; + return self.residualCamera; } mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(self.contentInset); diff --git a/platform/ios/src/MGLMapView_Private.h b/platform/ios/src/MGLMapView_Private.h index 4f7a49c370..bddb9b093e 100644 --- a/platform/ios/src/MGLMapView_Private.h +++ b/platform/ios/src/MGLMapView_Private.h @@ -8,6 +8,9 @@ namespace mbgl { /// Minimum size of an annotation’s accessibility element. FOUNDATION_EXTERN const CGSize MGLAnnotationAccessibilityElementMinimumSize; +/// Indicates that a method (that uses `mbgl::Map`) was called after app termination. +FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLUnderlyingMapUnavailableException; + @interface MGLMapView (Private) /// Currently shown popover representing the selected annotation. -- cgit v1.2.1