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

[ios] added check for annotation view animation #8565

Merged
merged 2 commits into from
Apr 12, 2017

Conversation

jmkiley
Copy link
Contributor

@jmkiley jmkiley commented Mar 29, 2017

Checks whether an annotation view has any animationKeys in updateAnnotations before adding the annotation view to reuse queue. Should prevent annotations that are being moved offscreen from disappearing.

Bug and Fix

Addresses #8489, uses @boundsj's suggested fix.

@jmkiley jmkiley added this to the ios-v3.6.0 milestone Mar 29, 2017
@jmkiley jmkiley added annotations Annotations on iOS and macOS or markers on Android bug iOS Mapbox Maps SDK for iOS labels Mar 29, 2017
@jmkiley jmkiley self-assigned this Mar 29, 2017
@jmkiley jmkiley changed the title [ios] added guard for animations, example [ios] added guard for annotation view animation Mar 29, 2017
@jmkiley jmkiley changed the title [ios] added guard for annotation view animation [ios] added check for annotation view animation Mar 29, 2017
Copy link
Contributor

@boundsj boundsj left a comment

Choose a reason for hiding this comment

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

I just made one suggestion about clarifying how (or guaranteeing) that the iosapp example moves a view into the reuse area.

@@ -49,17 +49,4 @@ - (void)setDragState:(MGLAnnotationViewDragState)dragState animated:(BOOL)animat

}

- (nullable id<CAAction>)actionForLayer:(CALayer *)layer forKey:(NSString *)event
Copy link
Contributor

Choose a reason for hiding this comment

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

Just noting that I think removing this makes sense only because I also think that we should feature UIView animation blocks as the recommended way of performing annotation view animations. Animation blocks have the convenient side effect of animating any open callout view along with the annotation view. cc @1ec5

annot.coordinate = self.mapView.centerCoordinate;
[self.mapView addAnnotation:annot];

CGPoint point = CGPointMake(-200, CGRectGetMidY(self.view.frame));
Copy link
Contributor

Choose a reason for hiding this comment

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

The magic value (-200) happens to move annotation views into the view reuse area outside of the viewport. If we change the size of annotation views in the future it may not. Would it be worth it to somehow special case this annotation to guarantee the size of the view? If not, it may at least be worth adding a comment here explaining why this value works today.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android bug iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants