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 }}
Repository navigation
UserCourseView should update instantaneously when user gestures cause camera changes #1731
When the user manually rotates the map using gestures, the puck should rotate synchronously with the map. Currently, there’s a bit of a lag that, while smooth, makes the puck look like it’s on a turntable. Similarly and more noticeably, when the user manually pans the map using gestures, the puck should move synchronously with the map instead of casually mosying over to the new location.
Both these issues would be fixed by disabling UserCourseView’s animation (or setting the animation duration to 0 seconds) when the map view’s camera changes for reasons other than course tracking. #1506 fixed the same issue, but only when transitioning between overview and turn-by-turn modes.
We've run into this pretty consistently recently. Per @1ec5 we should remove use of UIView animations in cases where the puck's location on screen changes in response to a map camera change.
The problem is with beginFromCurrentState: we kick off an animation, then atomically set the center a number of times during the animation (due to user gestures). The animation builds upon those explicit camera changes, resulting in a wonky additive effect. We probably need to cancel any animations when synchronizing the puck to the map due to a frame getting rendered.
In general, the map SDK has already solved the issues around synchronizing views to the map. So we can look to the MGLMapView implementation for clues about how to solve this issue.
Activity
1ec5 commentedon Sep 20, 2018
In CarPlay, it’s easy to reproduce this issue by showing and hiding the navigation bar:
akitchen commentedon Mar 13, 2019
We've run into this pretty consistently recently. Per @1ec5 we should remove use of UIView animations in cases where the puck's location on screen changes in response to a map camera change.
Related: #1949 (comment) (likely the same fix)
1ec5 commentedon Mar 14, 2019
We are synchronizing the puck on every rendered frame, even when not in course tracking mode:
mapbox-navigation-ios/MapboxNavigation/NavigationMapView.swift
Lines 271 to 273 in aef144b
All the while, location updates are coming in, so the map view has a legitimate reason to kick off animations:
mapbox-navigation-ios/MapboxNavigation/NavigationMapView.swift
Lines 341 to 343 in aef144b
The problem is with
beginFromCurrentState: we kick off an animation, then atomically set the center a number of times during the animation (due to user gestures). The animation builds upon those explicit camera changes, resulting in a wonky additive effect. We probably need to cancel any animations when synchronizing the puck to the map due to a frame getting rendered.In general, the map SDK has already solved the issues around synchronizing views to the map. So we can look to the MGLMapView implementation for clues about how to solve this issue.