Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Add completion handlers to animated MGLMapView methods #14381

Merged
merged 3 commits into from
Jun 22, 2019

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Apr 10, 2019

Added variants of several animated MGLMapView methods that accept completion handlers. This change does exacerbate the proliferation of camera-related methods in MGLMapView to a degree, but it’s in keeping with the principle that asynchronous operations should have completion handlers. Developers should use these methods instead of the camera-related MGLMapViewDelegate methods for more readable and less buggy code. Eventually, we may be able to call the delegate methods only in response to a user gesture or location update, in keeping with Cocoa best practices.

The specific methods added are:

  • -[MGLMapView setVisibleCoordinateBounds:edgePadding:animated:completionHandler:]
  • -[MGLMapView setContentInset:animated:completionHandler:] (iOS)
  • -[MGLMapView setContentInsets:animated:completionHandler:] (macOS)
  • -[MGLMapView setUserTrackingMode:animated:completionHandler:] (iOS)
  • -[MGLMapView setTargetCoordinate:animated:completionHandler:] (iOS)
  • -[MGLMapView showAnnotations:edgePadding:animated:completionHandler:]
  • -[MGLMapView selectAnnotation:animated:completionHandler:] (iOS)

Please double-check that completion handlers are only called on the main thread, and that I haven’t overlooked any code paths where these methods can return without calling the completion handler or where they can call the completion handler synchronously before calling it asynchronously as well. What I would give for a safe Objective-C equivalent to Swift’s defer keyword…

To do:

  • iOS
  • macOS

Fixes #5839 and fixes #5840.

/cc @mapbox/maps-ios @frederoni @vincethecoder

@1ec5 1ec5 added feature iOS Mapbox Maps SDK for iOS labels Apr 10, 2019
@1ec5 1ec5 self-assigned this Apr 10, 2019
@1ec5 1ec5 added the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Apr 10, 2019
}
else if (self.userTrackingState == MGLUserTrackingStateChanged)
{
// Subsequent updates get a more subtle animation.
[self didUpdateLocationIncrementallyAnimated:animated];
[self didUpdateLocationIncrementallyAnimated:animated completionHandler:completion];
}
[self unrotateIfNeededAnimated:YES];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method call can result in a snap-to-north animation. Would it be surprising if the animation could occur after the completion handler executes? Accounting for this edge case may complicate the code somewhat.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preferably at the very last chained animation but I don't have a strong opinion against that. However, unrotate is private so it shouldn't complex to hook up too much.

[mapView showAnnotations:@[annotation] edgePadding:UIEdgeInsetsZero animated:YES completionHandler:^{
[expectation fulfill];
}];
[self waitForExpectations:@[expectation] timeout:1];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We’ve had problems with expectations timing out in the past on CI. Since this method doesn’t accept a duration that can be set to 0 (should it?), I’d remove the expectation at the first sign of trouble on CI.

@@ -41,4 +41,104 @@ - (void)testCoordinateBoundsConversion {
XCTAssertTrue(CGRectIntersectsRect(spanningBoundsRect, rightAntimeridianBoundsRect), @"Something");
}

- (void)testUserTrackingModeCompletion {
__block BOOL completed = NO;
[mapView setUserTrackingMode:MGLUserTrackingModeNone animated:NO completionHandler:^{

This comment was marked as resolved.

@1ec5 1ec5 force-pushed the 1ec5-animation-completion-5839 branch 4 times, most recently from 381d005 to 03f718c Compare April 29, 2019 09:42
@1ec5 1ec5 added macOS Mapbox Maps SDK for macOS and removed ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold labels Apr 29, 2019
@1ec5 1ec5 modified the milestones: release-mojito, release-n Apr 29, 2019
@1ec5 1ec5 force-pushed the 1ec5-animation-completion-5839 branch from 03f718c to 595b9c2 Compare May 2, 2019 07:47
@1ec5 1ec5 added the navigation For the Mapbox Navigation SDK for Android or iOS or navigation use cases in general label May 2, 2019
direction,
MGLStringFromBOOL(animated));
[self setVisibleCoordinates:coordinates count:count edgePadding:insets direction:direction duration:animated ? MGLAnimationDuration : 0 animationTimingFunction:nil];
[self setVisibleCoordinates:coordinates count:count edgePadding:insets direction:self.direction duration:animated ? MGLAnimationDuration : 0 animationTimingFunction:nil];
Copy link
Contributor

@frederoni frederoni May 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.direction is the current value, not the new?

Copy link
Contributor Author

@1ec5 1ec5 May 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in this version of the method, no new direction is passed in, so we keep the current one. Ideally this would say −1, but the method incorrectly clamps negative values to 0: #14574.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I overlooked the signature change in the changeset.

Copy link
Contributor

@frederoni frederoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % one nit

@1ec5 1ec5 force-pushed the 1ec5-animation-completion-5839 branch from 595b9c2 to 64ba23f Compare May 3, 2019 17:47
@julianrex
Copy link
Contributor

What's stopping this from merging?

@friedbunny
Copy link
Contributor

friedbunny commented May 21, 2019

What's stopping this from merging?

Mainly, a review from someone who will have to maintain it over the longterm. 😅

My general concerns here are:

Maybe don’t add so much “new” API area

I think I’d like to see us deprecate the old completion-less methods, if only to reduce the cognitive burden of readers, autocompleters, and, eventually, maintainers. This’ll mean updating documentation sooner, rather than later, but that should be part of validating these changes, anyway.

Touching so many fundamental parts of platform functionality

Most of the functionality touched here is specific to our darwin SDKs, so we have to rely exclusively on the tests we write and the QA testing we do ourselves — there’s not much core or Android backstop. Asynchronous code can be relatively onerous to write stable tests against, but we need this functionality to be extremely solid and well-covered.

To that end, before we can accept this, I think we have to rigorously verify that each new method works as expected (and will continue to do so). That may be easier if this PR were split into smaller pieces, or if multiple reviewers were tasked with a subset of the new API.

@1ec5
Copy link
Contributor Author

1ec5 commented May 28, 2019

I think I’d like to see us deprecate the old completion-less methods, if only to reduce the cognitive burden of readers, autocompleters, and, eventually, maintainers. This’ll mean updating documentation sooner, rather than later, but that should be part of validating these changes, anyway.

I’m on board with this idea. There are way too many -setCenterCoordinate:… methods as it is. What do you think of the macOS portion of this diff? The macOS implementation of MGLMapView has never been quite as exuberant about center coordinate–setting methods, so it was quite a bit easier for me to retrofit that class.

As far as autocompletion goes, the primary effect of all these redundant methods is the same effect as a Swift method that specifies default values for most of its arguments. That’s a pretty reasonable practice in Swift, but I can understand the reluctance to keep it here in Objective-C, where there’s a significant code overhead.

I don’t think deprecating those redundant methods would reduce the size of this PR or the number of methods that it would add. Of the methods that this PR adds, is there any that you’d leave out?

Asynchronous code can be relatively onerous to write stable tests against, but we need this functionality to be extremely solid and well-covered.

To that end, before we can accept this, I think we have to rigorously verify that each new method works as expected (and will continue to do so).

MGLMapViewTests includes automated unit tests for many of the added methods. But mainly it tests edge cases, because I’m most worried about missing one of the many early return cases and because we don’t want these tests to run too long.

@1ec5 1ec5 force-pushed the 1ec5-animation-completion-5839 branch from 64ba23f to 4fc539c Compare May 29, 2019 01:01
@friedbunny friedbunny force-pushed the 1ec5-animation-completion-5839 branch from 4fc539c to 9c93e06 Compare June 11, 2019 22:24
Copy link
Contributor

@friedbunny friedbunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test failures in -[MGLAnnotationViewIntegrationTests testSelectionMoveIntoViewWithCallout] need to be investigated and addressed.

/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:165: error: -[MGLAnnotationViewIntegrationTests testSelectionMoveIntoViewWithCallout] : ((expectCalloutToBeFullyOnscreen == CGRectContainsRectWithAccuracy(self.mapView.bounds, calloutView.frame, 0.25)) is true) failed - Expect contains:1, Mapview:{{0, 0}, {414, 896}} annotation:{{5.5948931262606649, 392}, {51, 112}} callout:{{-9.4051068737393351, 335}, {87, 57}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150: error: -[MGLAnnotationViewIntegrationTests testSelectionMoveIntoViewWithCallout] : ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {414, 896}} frame:{{181.5, 796}, {51, 112}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150: error: -[MGLAnnotationViewIntegrationTests testSelectionMoveIntoViewWithCallout] : ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {414, 896}} frame:{{181.5, 784.5}, {51, 112}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:142: error: -[MGLAnnotationViewIntegrationTests testSelectionMoveIntoViewWithCallout] : (((latitudeDelta > epsilon) || (longitudeDelta > epsilon)) is true) failed - Deltas: lat=0.000000, long=0.000000
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:142: error: -[MGLAnnotationViewIntegrationTests testSelectionMoveIntoViewWithCallout] : (((latitudeDelta > epsilon) || (longitudeDelta > epsilon)) is true) failed - Deltas: lat=0.000000, long=0.000000
Test Case '-[MGLAnnotationViewIntegrationTests testSelectionMoveIntoViewWithCallout]' failed (3.520 seconds).

I pushed df6d7e7 updating this test battery to use replacement -[MGLMapView selectAnnotation:moveIntoView:animateSelection:completion:] method, per #14381 (comment).

/cc @julianrex

*/
- (void)selectAnnotation:(id <MGLAnnotation>)annotation moveIntoView:(BOOL)moveIntoView animateSelection:(BOOL)animateSelection;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is public API added in #13689 by @julianrex, but undocumented. This was evidently left undocumented so that we could change it at will, so this breaking change is fine.

Ticketed out this method for more discussion in #14904.

@friedbunny friedbunny removed this from the release-oolong milestone Jun 11, 2019
@friedbunny
Copy link
Contributor

friedbunny commented Jun 12, 2019

make ios-integration-test with Xcode 10.2.1 exhibits other failures...

MGLAnnotationViewIntegrationTests
testSelectionMoveIntoView, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{-5.5, 292}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoView, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{334.80688986952219, 292.00000000714897}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoView, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{164.50000001286816, -12.216370006849161}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoView, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{164.50000001858734, 601.92802726310947}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoView, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{-398, 292}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoView, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{727, 292}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoView, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{164.5, -708.5}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoView, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{164.5, 1292.5}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoViewWithBasicCallout, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{-17.902071770759061, 292.00000002049376}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoViewWithBasicCallout, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{330.34765826172378, 292.00000000190641}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoViewWithBasicCallout, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{164.50000004051091, 623.91725613652682}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoViewWithBasicCallout, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{345.82829861972164, 613.95690826366445}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoViewWithBasicCallout, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{164.5, -708.5}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoViewWithCallout, ((expectCalloutToBeFullyOnscreen == CGRectContainsRectWithAccuracy(self.mapView.bounds, calloutView.frame, 0.25)) is true) failed - Expect contains:1, Mapview:{{0, 0}, {375, 667}} annotation:{{325.10258023158605, 292.00000002573631}, {46, 83}} callout:{{304.60258023158605, 235.00000002573631}, {84.5, 57}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:165

                    NSStringFromCGRect(annotationFrameAfterSelection),
                    NSStringFromCGRect(calloutView.frame));
      }

testSelectionMoveIntoViewWithCallout, ((expectCalloutToBeFullyOnscreen == CGRectContainsRectWithAccuracy(self.mapView.bounds, calloutView.frame, 0.25)) is true) failed - Expect contains:1, Mapview:{{0, 0}, {375, 667}} annotation:{{164.50000004432368, 27.993816701249443}, {46, 83}} callout:{{144.00000004432368, -29.006183298750557}, {86.5, 57}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:165

                    NSStringFromCGRect(annotationFrameAfterSelection),
                    NSStringFromCGRect(calloutView.frame));
      }

testSelectionMoveIntoViewWithCallout, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{164.50000004051091, 624.29267533572533}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoViewWithCallout, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{164.5, 586.5}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoViewWithCallout, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{164.5, -708.5}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

testSelectionMoveIntoViewWithCallout, ((expectCalloutToBeFullyOnscreen == CGRectContainsRectWithAccuracy(self.mapView.bounds, calloutView.frame, 0.25)) is true) failed - Expect contains:1, Mapview:{{0, 0}, {375, 667}} annotation:{{164.5, -708.5}, {46, 83}} callout:{{146, -765.5}, {84, 57}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:165

                    NSStringFromCGRect(annotationFrameAfterSelection),
                    NSStringFromCGRect(calloutView.frame));
      }

testSelectionMoveIntoViewWithCallout, ((CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25)) is true) failed - Mapview:{{0, 0}, {375, 667}} frame:{{164.5, 625.5}, {46, 83}}
/mapbox-gl-native/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m:150

      
      XCTAssert(CGRectContainsRectWithAccuracy(self.mapView.bounds, annotationFrameAfterSelection, 0.25), @"Mapview:%@ frame:%@", NSStringFromCGRect(self.mapView.bounds), NSStringFromCGRect(annotationFrameAfterSelection));
      

Executed 45 tests, with 20 failures (0 unexpected) in 19.180 (19.213) seconds

@friedbunny
Copy link
Contributor

Deprecations are happening in #14959 and await the merging of this PR.

Copy link
Contributor

@friedbunny friedbunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @julianrex has indicated that the integration test failures here are separate, let’s move ahead with merging this and testing it out in release-p pre-releases.

@friedbunny friedbunny force-pushed the 1ec5-animation-completion-5839 branch from df6d7e7 to 082aa34 Compare June 22, 2019 00:09
@friedbunny friedbunny force-pushed the 1ec5-animation-completion-5839 branch from 082aa34 to 87fa146 Compare June 22, 2019 00:09
@friedbunny
Copy link
Contributor

friedbunny commented Jun 22, 2019

Rebased this on current master and moved the changelog entries to ios-v5.2.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS navigation For the Mapbox Navigation SDK for Android or iOS or navigation use cases in general
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add method to set user tracking mode with completion handler showAnnotations with completion handler
6 participants