You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
#1582 has regressed. While user tracking mode is off, the user location annotation view no longer animates between locations as location updates come in.
This issue reproduces in v3.4.0-alpha.3 but not v3.4.0-alpha.2.
Tracked this down to bb2f627#diff-1994707fb909ec523ea083950eac603eR246, where we excluded position from being animatable. This change was meant to only exclude implicit animations, but it is also canceling our UIView animation in updateUserLocationAnnotationViewAnimatedWithDuration:.
Right, this is correct, but now affects the user dot since we've moved it to MGLAnnotationView. We can make an exclusion for the user dot class and subclasses?
The simplest fix is to allow position animations in MGLAnnotationView, if the class is a kind of MGLUserLocationAnnotationView:
diff --git a/platform/ios/src/MGLAnnotationView.mm b/platform/ios/src/MGLAnnotationView.mm
index c37adc5..352e1d3 100644
--- a/platform/ios/src/MGLAnnotationView.mm+++ b/platform/ios/src/MGLAnnotationView.mm@@ -249,7 +249,8 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecogni
- (id<CAAction>)actionForLayer:(CALayer *)layer forKey:(NSString *)event
{
// Allow mbgl to drive animation of this view’s bounds.
- if ([event isEqualToString:@"bounds"] || [event isEqualToString:@"position"])+ if ([event isEqualToString:@"bounds"] ||+ ([event isEqualToString:@"position"] && ! [self isKindOfClass:MGLUserLocationAnnotationView.class]))
{
return [NSNull null];
}
... but special-casing the user location annotation doesn’t strike me as a good fix. Moving other custom annotation views around the map has proven difficult and I think that’s a problem we need to solve.
No, that's definitely a bug. I think the override in question is unnecessary as long as we bracket -updateAnnotationViews with a transaction that disables animations.
Activity
friedbunny commentedon Aug 30, 2016
Tracked this down to bb2f627#diff-1994707fb909ec523ea083950eac603eR246, where we excluded
positionfrom being animatable. This change was meant to only exclude implicit animations, but it is also canceling our UIView animation inupdateUserLocationAnnotationViewAnimatedWithDuration:.1ec5 commentedon Aug 30, 2016
bb2f627 went into v3.3.0-beta.3 as part of #5550.
incanus commentedon Aug 30, 2016
Right, this is correct, but now affects the user dot since we've moved it to
MGLAnnotationView. We can make an exclusion for the user dot class and subclasses?friedbunny commentedon Aug 30, 2016
The simplest fix is to allow
positionanimations in MGLAnnotationView, if the class is a kind of MGLUserLocationAnnotationView:... but special-casing the user location annotation doesn’t strike me as a good fix. Moving other custom annotation views around the map has proven difficult and I think that’s a problem we need to solve.
friedbunny commentedon Aug 30, 2016
That you can’t use UIView block-based animations on your annotation views doesn’t seem correct to me, either. Is that how we want it to work?
1ec5 commentedon Aug 30, 2016
No, that's definitely a bug. I think the override in question is unnecessary as long as we bracket
-updateAnnotationViewswith a transaction that disables animations.friedbunny commentedon Aug 30, 2016
It looks like we already do that: MGLMapView.mm#L4548
incanus commentedon Aug 30, 2016
Ah, yes! We should be ok here without doing anything for the layer actions directly.