Skip to content

Commit 7ed378d

Browse files
kriedgithub-actions[bot]
authored andcommitted
Revert setting initial route offset when starting navigation #12780 (#13717)
(cherry picked from commit 8db7696d06d3bb06c03b8ec975bbb2ff5e743bf1) GitOrigin-RevId: 610e2647a0c1f4bcf43a38eae87aee58785926d6
1 parent 8b115f8 commit 7ed378d

2 files changed

Lines changed: 5 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
* MapboxNavigationCore now requires [MapboxMaps v11.22.0-rc.1](https://github.com/mapbox/mapbox-maps-ios/releases/tag/v11.22.0-rc.1)
88
* MapboxNavigationCore now requires [MapboxNavigationNative v324.22.0-rc.1](https://github.com/mapbox/mapbox-navigation-native-ios/releases/tag/v324.22.0-rc.1)
99

10+
### Map
11+
12+
* Fixed an issue where a route could be drawn truncated when restarting a navigation session, a regression from the v3.20.0. This will cause the traversed route line to reappear when switching to an alternative route and back.
13+
1014
## 3.21.0
1115

1216
### Packaging

Sources/MapboxNavigationCore/Map/Style/NavigationMapStyleManager.swift

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ final class NavigationMapStyleManager {
312312
) {
313313
let features = routeLineMapFeatures(
314314
routes: routes,
315-
routeProgress: routeProgress,
316315
config: config,
317316
featureProvider: featureProvider,
318317
customizedLayerProvider: customizedLineLayerProvider,
@@ -671,29 +670,15 @@ final class NavigationMapStyleManager {
671670

672671
private func routeLineMapFeatures(
673672
routes: NavigationRoutes,
674-
routeProgress: RouteProgress? = nil,
675673
config: MapStyleConfig,
676674
featureProvider: RouteLineFeatureProvider,
677675
customizedLayerProvider: CustomizedTypeLayerProvider<LineLayer>,
678676
customPosition: LayerPosition?
679677
) -> [(RouteLineStyleContent, MapFeature)] {
680678
var features: [(RouteLineStyleContent, MapFeature)] = []
681-
682-
let offset = if config.routeLineTracksTraversal,
683-
let routeProgress,
684-
!routeProgress.routeIsComplete,
685-
let coordinate = mapView.location.latestLocation?.coordinate,
686-
let shape = routes.mainRoute.route.shape,
687-
let distance = shape.distance(), distance > 0,
688-
let traversedDistance = shape.distance(to: coordinate)
689-
{
690-
traversedDistance / distance
691-
} else {
692-
0.0
693-
}
694679
let mainRouteFeature = routes.mainRoute.route.routeLineMapFeatures(
695680
ids: .main,
696-
offset: offset,
681+
offset: 0,
697682
isSoftGradient: config.congestionConfiguration.displaySoftGradientForTraffic,
698683
isAlternative: false,
699684
config: config,

0 commit comments

Comments
 (0)