From 9f6c194b2443ec9d804695f593271ee447fba941 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 31 May 2024 10:43:24 -0700 Subject: [PATCH] Fix simulated speed label in NavigationViewController --- CHANGELOG.md | 4 +++- MapboxNavigation/NavigationViewController.swift | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5239a016..2f795b20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,9 @@ - Deprecated `DayStyle()`/`NightStyle()` initializers because they were backed by an implicit tile service. If these default styles *are* still used, they'll now use the MapLibre demo style. - `NavigationViewController` now expects explicit style URLs with `NavigationViewController(route:dayStyleURL:nightStyleURL:...)` or NavigationViewController(route:dayStyle:nightStyle:...)` and the existing initializer, which allowed "default" styles, is deprecated and uses the MapLibre demo styles. - Fix: NavigationViewController was not re-routing when the user went off route. - - Merged in . + - Merged in + - Fix: NavigationViewController displayed incorrect `speedMultiplier` when using SimulatedLocationManager + - Merged in ## v2.0.0 (May 23, 2023) - Upgrade minimum iOS version from 11.0 to 12.0. diff --git a/MapboxNavigation/NavigationViewController.swift b/MapboxNavigation/NavigationViewController.swift index 5e163ad8..216640df 100644 --- a/MapboxNavigation/NavigationViewController.swift +++ b/MapboxNavigation/NavigationViewController.swift @@ -491,8 +491,8 @@ open class NavigationViewController: UIViewController { UIApplication.shared.isIdleTimerDisabled = true } - if self.routeController.locationManager is SimulatedLocationManager { - let localized = String.Localized.simulationStatus(speed: 1) + if let simulatedLocationManager = self.routeController.locationManager as? SimulatedLocationManager { + let localized = String.Localized.simulationStatus(speed: Int(simulatedLocationManager.speedMultiplier)) self.mapViewController?.statusView.show(localized, showSpinner: false, interactive: true) } }