From da4ca06f5f9131c6992264bb1cfacc93898189de Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Fri, 29 Apr 2016 11:43:43 -0600 Subject: [PATCH] [ios] Disable annotation view implicit animation Like https://github.com/mapbox/mapbox-gl-native/pull/3683, this change prevents Core Animation from implicitly animating changes to the annotation's bounds. This is done to reduce lag during map interactions like pan and drag. --- platform/ios/src/MGLAnnotationView.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/ios/src/MGLAnnotationView.m b/platform/ios/src/MGLAnnotationView.m index e02ac499883..9fd173aa12e 100644 --- a/platform/ios/src/MGLAnnotationView.m +++ b/platform/ios/src/MGLAnnotationView.m @@ -9,4 +9,14 @@ @interface MGLAnnotationView () @implementation MGLAnnotationView +- (id)actionForLayer:(CALayer *)layer forKey:(NSString *)event +{ + // Allow mbgl to drive animation of this view’s bounds. + if ([event isEqualToString:@"bounds"]) + { + return [NSNull null]; + } + return [super actionForLayer:layer forKey:event]; +} + @end \ No newline at end of file