[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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user