-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios] added check for annotation view animation #8565
Conversation
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.
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 |
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.
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
platform/ios/app/MBXViewController.m
Outdated
annot.coordinate = self.mapView.centerCoordinate; | ||
[self.mapView addAnnotation:annot]; | ||
|
||
CGPoint point = CGPointMake(-200, CGRectGetMidY(self.view.frame)); |
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.
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.
40984a5
to
510c212
Compare
Checks whether an annotation view has any
animationKeys
inupdateAnnotations
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.