[ios] Added centerOffset to MGLAnnotationView (#5062)

* [ios] Added centerOffset to MGLAnnotationView

* [ios] Reposition immediately after changing the centerOffset

closes #5059
This commit is contained in:
frederoni
2016-05-18 09:47:54 -07:00
committed by Minh Nguyễn
parent 8ee222c45e
commit e8ea7483a7
4 changed files with 23 additions and 0 deletions

View File

@@ -27,6 +27,19 @@
// Intentionally left blank. The default implementation of this method does nothing.
}
- (void)setCenterOffset:(CGVector)centerOffset
{
_centerOffset = centerOffset;
self.center = self.center;
}
- (void)setCenter:(CGPoint)center
{
center.x += _centerOffset.dx;
center.y += _centerOffset.dy;
[super setCenter:center];
}
- (id<CAAction>)actionForLayer:(CALayer *)layer forKey:(NSString *)event
{
// Allow mbgl to drive animation of this view’s bounds.