Skip to content

Commit 002fb9b

Browse files
authored
Use 0.0 bearing while previewing routes on CarPlay. (#3958)
1 parent fdbb121 commit 002fb9b

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Sources/MapboxNavigation/CarPlayManager.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,10 @@ extension CarPlayManager: CPMapTemplateDelegate {
766766
}
767767

768768
let navigationMapView = carPlayMapViewController.navigationMapView
769-
navigationMapView.showcase(routes, animated: true)
769+
let cameraOptions = CameraOptions(bearing: 0.0)
770+
navigationMapView.showcase(routes,
771+
routesPresentationStyle: .all(shouldFit: true, cameraOptions: cameraOptions),
772+
animated: true)
770773

771774
delegate?.carPlayManager(self, selectedPreviewFor: trip, using: routeChoice)
772775
}

Sources/MapboxNavigation/CarPlayMapViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ open class CarPlayMapViewController: UIViewController {
230230

231231
navigationMapView.mapView.ornaments.options.logo.visibility = .hidden
232232
navigationMapView.mapView.ornaments.options.attributionButton.visibility = .hidden
233+
navigationMapView.mapView.ornaments.options.compass.visibility = .hidden
233234

234235
self.view = navigationMapView
235236
}

Sources/MapboxNavigation/NavigationMapView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,9 +2127,9 @@ open class NavigationMapView: UIView {
21272127
let edgeInsets = safeArea + UIEdgeInsets.centerEdgeInsets
21282128
let bearing = customCameraOptions.flatMap({ $0.bearing }).map({ CGFloat($0) })
21292129
if let cameraOptions = mapView?.mapboxMap.camera(for: geometry,
2130-
padding: customCameraOptions?.padding ?? edgeInsets,
2131-
bearing: bearing,
2132-
pitch: customCameraOptions?.pitch) {
2130+
padding: customCameraOptions?.padding ?? edgeInsets,
2131+
bearing: bearing,
2132+
pitch: customCameraOptions?.pitch) {
21332133
mapView?.camera.ease(to: cameraOptions, duration: animated ? 1.0 : 0.0)
21342134
}
21352135
}

0 commit comments

Comments
 (0)