Skip to content

Commit cc92fb5

Browse files
authored
Fill Incident properties from IncidentInfo (#4045)
* Fill Incident properties from IncidentInfo * Update changelog
1 parent 77f8bf5 commit cc92fb5

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
* Added `ResumeButton.borderWidth`, `ResumeButton.cornerRadius` and `ResumeButton.borderColor` properties that allow `ResumeButton`'s style modification. ([#3996](https://github.com/mapbox/mapbox-navigation-ios/pull/3996))
4545
* Fixed a crash when dismissing `NavigationViewController`. ([#4029](https://github.com/mapbox/mapbox-navigation-ios/pull/4029))
4646
* Fixed an issue where `StyleManager` was not applying style on iPad. ([#4039](https://github.com/mapbox/mapbox-navigation-ios/pull/4039))
47+
* Added filling of `Incident` properties `countryCodeAlpha3`, `countryCode`, `roadIsClosed`, `longDescription`, `numberOfBlockedLanes`, `congestionLevel`, `affectedRoadNames` when receiving `RoadObject` via Electronic Horizon. ([#4045](https://github.com/mapbox/mapbox-navigation-ios/pull/4045))
4748

4849
## v2.6.0
4950

Sources/MapboxCoreNavigation/Incident.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extension Incident {
3333
@unknown default:
3434
fatalError("Unknown IncidentInfo type.")
3535
}
36-
36+
3737
self.init(identifier: incidentInfo.id,
3838
type: incidentType,
3939
description: incidentInfo.description ?? "",
@@ -45,7 +45,15 @@ extension Incident {
4545
subtypeDescription: incidentInfo.subTypeDescription,
4646
alertCodes: Set(incidentInfo.alertcCodes.map { $0.intValue }),
4747
lanesBlocked: BlockedLanes(descriptions: incidentInfo.lanesBlocked),
48-
shapeIndexRange: -1 ..< -1)
48+
shapeIndexRange: -1 ..< -1,
49+
countryCodeAlpha3: incidentInfo.iso_3166_1_alpha3,
50+
countryCode: incidentInfo.iso_3166_1_alpha2,
51+
roadIsClosed: incidentInfo.isRoadClosed,
52+
longDescription: incidentInfo.longDescription,
53+
numberOfBlockedLanes: incidentInfo.numLanesBlocked?.intValue,
54+
congestionLevel: incidentInfo.congestion?.value?.intValue,
55+
affectedRoadNames: incidentInfo.affectedRoadNames
56+
)
4957
}
5058
}
5159

0 commit comments

Comments
 (0)