Repository navigation
Fix route preview in CarPlay - #2022
Conversation
This issue only reproduces in the example application when returning to the main map from the favorites list. When returning from the search template, the map immediately tilts and enables user tracking mode, thanks to this special case: mapbox-navigation-ios/MapboxNavigation/CarPlayManager.swift Lines 333 to 342 in 2a75525 |
|
Tracking the case of returning to the main map as tail work in #2030. |
| if let userCourseView = mapView.userCourseView { | ||
| let midX = userCourseView.bounds.midX | ||
| let midY = userCourseView.bounds.midY | ||
| edgePadding += UIEdgeInsets(top: midY, left: midX, bottom: midY, right: midX) |
There was a problem hiding this comment.
This if block seems to be ensuring that the course view is always fully visible on the map. But about the waypoints? And if we’re previewing a route where the route line might extend in all directions from the user’s current location, then this alone won’t ensure that the whole route fits on the map. We have logic elsewhere about resetting or fitting the camera. Maybe we should reuse it instead of trying to reimplement some of it via edge insets.
…where "fly to current location" wasn't working when coming from favorites or nav-end.
|
That fixes #2030 as well, then. |
# Conflicts: # MapboxNavigation/UIEdgeInsets.swift
|
Behavior remains unchanged from demo video posted earlier. |
1ec5
left a comment
There was a problem hiding this comment.
Remember to add a changelog entry.
This PR attempts to fix the padding when previewing a route in CarPlay which wasn't always fully visible before.
There is at least one issue we need to fix before this PR can land.
To reproduce: Preview a route, go back to the initial screen. The route is selected according to
isOverviewingRouteand accounted for in map view’s content inset, but the route is not drawn on the map. Should the route be selected or deselected?cc @1ec5