Repository navigation
Update UserCourseView instantaneously - #1838
Conversation
to a gesture recognizer
There was a problem hiding this comment.
I would preferably avoid this frame by frame tracking but using updateCourseTracking(location:camera:animated:false) did not mitigate the lag/animation. cc @1ec5
There was a problem hiding this comment.
Perhaps there’s a race condition in which this method gets called before the map view updates its center coordinate to reflect the margin change, so that by the time we convert the user location to a center point within the (non)animation block, the center point still reflects the old margins.
mapbox-navigation-ios/MapboxNavigation/NavigationMapView.swift
Lines 332 to 334 in a0e5dbc
Temporarily enabling frame-by-frame course tracking ensures that the view moves as soon as the map adjusts to the new content insets (since that requires the map view to render another frame):
mapbox-navigation-ios/MapboxNavigation/NavigationMapView.swift
Lines 261 to 264 in a0e5dbc
Temporarily reenabling frame-by-frame course tracking isn’t the end of the world, though if it really comes down to this race condition, then I’d think a shorter duration would still be sufficient to work around it.
ce7b1bd to
5d0a34f
Compare
1ec5
left a comment
There was a problem hiding this comment.
Suggested changelog entry:
Fixed an issue causing
UserCourseViewto lag behindNavigationMapViewwhenever the map’s camera or content insets change significantly.
There was a problem hiding this comment.
Perhaps there’s a race condition in which this method gets called before the map view updates its center coordinate to reflect the margin change, so that by the time we convert the user location to a center point within the (non)animation block, the center point still reflects the old margins.
mapbox-navigation-ios/MapboxNavigation/NavigationMapView.swift
Lines 332 to 334 in a0e5dbc
Temporarily enabling frame-by-frame course tracking ensures that the view moves as soon as the map adjusts to the new content insets (since that requires the map view to render another frame):
mapbox-navigation-ios/MapboxNavigation/NavigationMapView.swift
Lines 261 to 264 in a0e5dbc
Temporarily reenabling frame-by-frame course tracking isn’t the end of the world, though if it really comes down to this race condition, then I’d think a shorter duration would still be sufficient to work around it.
# Conflicts: # CHANGELOG.md
Fixes #1731
cc @1ec5 @vincethecoder @JThramer