Skip to content
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Fixed an issue where tapping on a route duration annotation that overlaps a different route would cause the wrong route to be passed into `NavigationMapViewDelegate.navigationMapView(_:didSelect:)` or `NavigationMapViewDelegate.navigationMapView(_:didSelect:)`. ([#4133](https://github.com/mapbox/mapbox-navigation-ios/pull/4133))
* Fixed an issue where the shields in the instruction are using the style from last navigation session with the `NavigationMapView` injection used in the new session. ([#4197](https://github.com/mapbox/mapbox-navigation-ios/pull/4197))
* Fixed an issue where the `NavigationMapView.localizeLabels()` method only localized map labels according to the user’s Preferred Language Order setting if the application also had a localization in the preferred language. ([#4205](https://github.com/mapbox/mapbox-navigation-ios/pull/4205))
* Added `NavigationViewController.annotatesIntersectionsAlongRoute` and `CarPlayNavigationViewController.annotatesIntersectionsAlongRoute` to annotate intersections on the current route step during active navigation. ([#4185](https://github.com/mapbox/mapbox-navigation-ios/pull/4185))

### Banners and guidance instructions

Expand Down
4 changes: 4 additions & 0 deletions MapboxNavigation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@
B4BB0AD72704D1E6006F502D /* multileg_route.json in Resources */ = {isa = PBXBuildFile; fileRef = B4BB0AD62704D1E6006F502D /* multileg_route.json */; };
B4C4FFA028ADB19600C7C253 /* RouteLineLayerPositionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4C4FF9F28ADB19600C7C253 /* RouteLineLayerPositionTests.swift */; };
B4C8E39E286B72FA004D3EDD /* FeedbackViewControllerSnapshotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4C8E39D286B72FA004D3EDD /* FeedbackViewControllerSnapshotTests.swift */; };
B4DA62F128EE0A78004A66B8 /* NavigationMapView+Annotations.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4DA62F028EE0A78004A66B8 /* NavigationMapView+Annotations.swift */; };
B4E19C47268114840011581F /* NavigationLocationProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4E19C46268114840011581F /* NavigationLocationProvider.swift */; };
B4F4FEAD27AB1E11003915A9 /* SpriteRepositoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4B61B9627A882E200AA127E /* SpriteRepositoryTests.swift */; };
B4FD842827ED1980002662C4 /* UserPuckStyleKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4FD842727ED1980002662C4 /* UserPuckStyleKit.swift */; };
Expand Down Expand Up @@ -1060,6 +1061,7 @@
B4C4FF9F28ADB19600C7C253 /* RouteLineLayerPositionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouteLineLayerPositionTests.swift; sourceTree = "<group>"; };
B4C8E39D286B72FA004D3EDD /* FeedbackViewControllerSnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedbackViewControllerSnapshotTests.swift; sourceTree = "<group>"; };
B4D4291826260D5900EE92A8 /* MBXInfo.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = MBXInfo.plist; sourceTree = "<group>"; };
B4DA62F028EE0A78004A66B8 /* NavigationMapView+Annotations.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NavigationMapView+Annotations.swift"; sourceTree = "<group>"; };
B4E19C46268114840011581F /* NavigationLocationProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationLocationProvider.swift; sourceTree = "<group>"; };
B4FD842727ED1980002662C4 /* UserPuckStyleKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserPuckStyleKit.swift; sourceTree = "<group>"; };
C51511D020EAC89D00372A91 /* CPMapTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CPMapTemplate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1550,6 +1552,7 @@
8A0E0A66257ADD3D00C2E924 /* Navigation */ = {
isa = PBXGroup;
children = (
B4DA62F028EE0A78004A66B8 /* NavigationMapView+Annotations.swift */,
B4E19C46268114840011581F /* NavigationLocationProvider.swift */,
8A2081C925E07CED00F9B8A6 /* NavigationMapViewIdentifiers.swift */,
8A2081CA25E07CED00F9B8A6 /* RouteLineType.swift */,
Expand Down Expand Up @@ -2869,6 +2872,7 @@
8AA0386327F7B3F50007BD2D /* BottomBannerViewControllerDelegate.swift in Sources */,
8D53136B20653FA20044891E /* ExitView.swift in Sources */,
8D3322272200E4CA001D44AA /* NavigationOptions.swift in Sources */,
B4DA62F128EE0A78004A66B8 /* NavigationMapView+Annotations.swift in Sources */,
B41299CD26D6DE4D004031A3 /* RouteProgress+Arrival.swift in Sources */,
351BEC011E5BCC63006FE110 /* ManeuverView.swift in Sources */,
35B1E2951F1FF8EC00A13D32 /* UserCourseView.swift in Sources */,
Expand Down
32 changes: 32 additions & 0 deletions Sources/MapboxNavigation/CarPlayNavigationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@ open class CarPlayNavigationViewController: UIViewController, BuildingHighlighti
}
}

/**
A Boolean value that determines whether the map annotates the intersections on current step during active navigation.

If `true`, the map would display an icon of a traffic control device on the intersection,
such as traffic signal, stop sign, yield sign, or railroad crossing.
Defaults to `true`.
*/
public var annotatesIntersectionsAlongRoute: Bool = true {
didSet {
updateIntersectionsAlongRoute()
}
}

/**
`AlternativeRoute`s user might take during this trip to reach the destination using another road.

Expand Down Expand Up @@ -777,8 +790,13 @@ open class CarPlayNavigationViewController: UIViewController, BuildingHighlighti
navigationMapView?.showWaypoints(on: routeProgress.route, legIndex: legIndex)
}

if annotatesIntersectionsAlongRoute {
navigationMapView?.updateIntersectionAnnotations(with: routeProgress)
}

navigationMapView?.updateRouteLine(routeProgress: routeProgress, coordinate: location.coordinate, shouldRedraw: legIndex != currentLegIndexMapped)
currentLegIndexMapped = legIndex

}

private func checkTunnelState(at location: CLLocation, along progress: RouteProgress) {
Expand Down Expand Up @@ -872,6 +890,10 @@ open class CarPlayNavigationViewController: UIViewController, BuildingHighlighti
navigationMapView?.removeArrow()
}
navigationMapView?.showWaypoints(on: progress.route, legIndex: legIndex)

if annotatesIntersectionsAlongRoute {
navigationMapView?.updateIntersectionAnnotations(with: progress)
}
}

func updateManeuvers(_ routeProgress: RouteProgress) {
Expand Down Expand Up @@ -1013,6 +1035,15 @@ open class CarPlayNavigationViewController: UIViewController, BuildingHighlighti
carInterfaceController.dismissTemplate(animated: true)
carInterfaceController.presentTemplate(waypointArrival, animated: true)
}

func updateIntersectionsAlongRoute() {
if annotatesIntersectionsAlongRoute {
navigationMapView?.updateIntersectionSymbolImages(styleType: styleManager?.currentStyleType)
navigationMapView?.updateIntersectionAnnotations(with: navigationService.routeProgress)
} else {
navigationMapView?.removeIntersectionAnnotations()
}
}
}

// MARK: StyleManagerDelegate Methods
Expand Down Expand Up @@ -1040,6 +1071,7 @@ extension CarPlayNavigationViewController: StyleManagerDelegate {
wayNameView?.label.updateStyle(styleURI: styleURI, idiom: .carPlay)
updateMapTemplateStyle()
updateManeuvers(navigationService.routeProgress)
updateIntersectionsAlongRoute()
}

public func styleManagerDidRefreshAppearance(_ styleManager: StyleManager) {
Expand Down
Loading