-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fixes a bug where the animated parameter of -[MGLMapView selectAnnotation:animated:] was ignored. #13689
Conversation
Fixed bug where animateSelection was always YES in selectAnnotation:animated:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this change looks good. Just one question that jumped out at me; not sure whether we need to do anything about it.
CGRect positioningRect = [self positioningRectForAnnotation:annotation defaultCalloutPoint:CGPointZero]; | ||
[self selectAnnotation:annotation moveOnscreen:animated animateSelection:YES calloutPositioningRect:positioningRect]; | ||
[self selectAnnotation:annotation moveIntoView:moveIntoView animateSelection:animateSelection calloutPositioningRect:positioningRect]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should deselection in response to another annotation being selected also honor the animated
flag, for consistency?
mapbox-gl-native/platform/ios/src/MGLMapView.mm
Line 4596 in e2e38dd
[self deselectAnnotation:self.selectedAnnotation animated:NO]; |
mapbox-gl-native/platform/ios/src/MGLMapView.mm
Line 4882 in e2e38dd
[annotationView setSelected:NO animated:animated]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick review!
I had the very same question 🙂 I can imagine situations where different applications would want different results. I think leaving as is makes the most sense at present, and we can tackle in a subsequent PR if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for clarifying your intent. Let’s be sure to circle back to these docs when we’re more certain about the implementation.
Fixes: #13055
Also:
moveOnscreen
->moveIntoView
)-[MGLMapView selectAnnotation:moveIntoView:animateSelection:]
to the public header, but marked as undocumented.