Skip to content

Commit

Permalink
Fix the rawLocation used for the user puck (#7021)
Browse files Browse the repository at this point in the history
  • Loading branch information
kried authored Oct 17, 2024
1 parent d963019 commit fc57897
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
* Fixed a possible case when `.relativeDurationsOnAlternativeManuever` annotations can be visible even if they were hidden previously.
* Added the support for specifying the custom route line layer position for map styles without slots support by `NavigationMapView.customRouteLineLayerPosition`.

### Location

* Fixed the case when a raw, non-map-matched location was used in CarPlay.

### Other changes

* `NavigationViewController` transitions navigation to the `idle` state when it is dismissed.
Expand Down
5 changes: 3 additions & 2 deletions Examples/CoreSDKExample/Navigation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ final class Navigation: ObservableObject {

init() {
let config = CoreConfig(
credentials: .init() // You can pass a custom token if you need to
credentials: .init(), // You can pass a custom token if you need to,
locationSource: .live
)
let navigationProvider = MapboxNavigationProvider(coreConfig: config)
self.core = navigationProvider.mapboxNavigation
Expand Down Expand Up @@ -54,7 +55,7 @@ final class Navigation: ObservableObject {
.assign(to: &$activeNavigationRoutes)

core.navigation().locationMatching
.map { $0.location }
.map { $0.enhancedLocation }
.assign(to: &$currentLocation)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ open class CarPlayMapViewController: UIViewController {
speedLimitView.signStandard = state.speedLimit.signStandard
speedLimitView.speedLimit = state.speedLimit.value

speedLimitView.currentSpeed = state.location.speed
speedLimitView.currentSpeed = state.enhancedLocation.speed
}

if let wayNameView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ open class CarPlayNavigationViewController: UIViewController {

func progressDidChange(_ routeProgress: RouteProgress?) {
guard let routeProgress,
let location = core.navigation().currentLocationMatching?.location
let location = core.navigation().currentLocationMatching?.enhancedLocation
else {
return
}
Expand Down Expand Up @@ -1015,7 +1015,7 @@ open class CarPlayNavigationViewController: UIViewController {

extension CarPlayNavigationViewController: StyleManagerDelegate {
public func location(for styleManager: StyleManager) -> CLLocation? {
if let location = core.navigation().currentLocationMatching?.location {
if let location = core.navigation().currentLocationMatching?.enhancedLocation {
return location
} else {
return nil
Expand Down

0 comments on commit fc57897

Please sign in to comment.