[ios] Disable implicit animation of user annotation pitch changes (#6122)

- Subtly improves the performance of the shadow, while performing the pitch gesture.
This commit is contained in:
Jason Wray
2016-08-23 13:59:26 -04:00
committed by GitHub
parent c034ba4ee1
commit fcb710fafe

View File

@@ -77,11 +77,17 @@ const CGFloat MGLUserLocationAnnotationArrowSize = MGLUserLocationAnnotationPuck
{
if (self.mapView.camera.pitch != _oldPitch)
{
// disable implicit animation
[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];
CATransform3D t = CATransform3DRotate(CATransform3DIdentity, MGLRadiansFromDegrees(self.mapView.camera.pitch), 1.0, 0, 0);
self.layer.sublayerTransform = t;
[self updateFaux3DEffect];
[CATransaction commit];
_oldPitch = self.mapView.camera.pitch;
}
}