Skip to content

Commit fb0a314

Browse files
authored
Fixed the possible situation when the upcoming route leg is rendered above the active route leg (#4589)
1 parent 33275ec commit fb0a314

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* Added PrivacyInfo.xcprivacy support. ([#4573](https://github.com/mapbox/mapbox-navigation-ios/pull/4573))
2929
* Removed `NavigationEventsManager.init(activeNavigationDataSource:passiveNavigationDataSource:accessToken:mobileEventsManager:)` in favor of `NavigationEventsManager.init(activeNavigationDataSource:passiveNavigationDataSource:accessToken:)`. ([#4572](https://github.com/mapbox/mapbox-navigation-ios/pull/4572))
3030
* Fixed a rare issue that could lead to memory corruption under specific conditions. This was resolved by replacing the internal image downloader with brand new actor-based implementation. ([#4588](https://github.com/mapbox/mapbox-navigation-ios/pull/4588))
31+
* Fixed the possible situation when the upcoming route leg is rendered above the active route leg. ([#4588](https://github.com/mapbox/mapbox-navigation-ios/pull/4588))
3132

3233
## v2.17.0
3334

Sources/MapboxNavigation/NavigationMapView+VanishingRouteLine.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ extension NavigationMapView {
433433
return self.congestionColor(for: nil, isMain: isMain)
434434
}
435435
}
436-
437-
return self.routeCasingColor
436+
437+
return .clear
438438
}
439439
})
440440

Tests/MapboxNavigationTests/NavigationMapViewTests.swift

+21
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,27 @@ class NavigationMapViewTests: TestCase {
426426
XCTAssertEqual(routeLineGradient[0.0], navigationMapView.trafficLowColor)
427427
}
428428

429+
func testGenerateRouteLineGradientWithMultilegRoute() {
430+
let coordinates: [CLLocationCoordinate2D] = [
431+
CLLocationCoordinate2D(latitude: 37.798, longitude: -122.398),
432+
CLLocationCoordinate2D(latitude: 37.795, longitude: -122.398),
433+
CLLocationCoordinate2D(latitude: 37.795, longitude: -122.395),
434+
]
435+
let congestionSegment: CongestionSegment = (coordinates, CongestionLevel.low)
436+
var feature = Feature(geometry: .lineString(LineString(congestionSegment.0)))
437+
feature.properties = [
438+
CongestionAttribute: .string(String(describing: congestionSegment.1)),
439+
CurrentLegAttribute: false
440+
]
441+
let congestionFeatures = [feature]
442+
443+
let routeLineGradient = navigationMapView.routeLineCongestionGradient(congestionFeatures: congestionFeatures,
444+
isMain: true,
445+
isSoft: false)
446+
XCTAssertEqual(routeLineGradient.count, 1)
447+
XCTAssertEqual(routeLineGradient[0.0], .clear)
448+
}
449+
429450
func testGenerateRouteLineRestrictedGradient() {
430451
let coordinates: [CLLocationCoordinate2D] = [
431452
CLLocationCoordinate2D(latitude: 1, longitude: 0),

0 commit comments

Comments
 (0)