Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to MapboxMaps v10.4.0-rc.1, MapboxNavigationNative v92.0.0. #3765

Merged
merged 26 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
28f8313
Update to Mapbox Maps `v10.4.0-beta.1`.
MaximAlien Feb 25, 2022
057f47f
Update changelog.
MaximAlien Feb 25, 2022
fc28612
Update to Mapbox Navigation Native `v90.0.0`.
MaximAlien Mar 4, 2022
0125e7e
Update `CocoaPodsTest` target to the latest dependencies.
MaximAlien Mar 4, 2022
b0ca0aa
Fix failing tests.
MaximAlien Mar 11, 2022
e6b99e8
MapboxCommon v21.2.0, Polyline v5.0.3
1ec5 Mar 11, 2022
cf79a8c
Added railroad crossing road objects
1ec5 Mar 11, 2022
197de73
Suppressed unused variable warning
1ec5 Mar 11, 2022
e66c404
Updated changelog
1ec5 Mar 11, 2022
a67a7cc
Migrated Navigator from Routes to NavigationRoutes
1ec5 Mar 11, 2022
a39a623
Update Maps SDK to `v10.4.0-rc.1` and Navigation Native to `v92.0.0`.
MaximAlien Mar 16, 2022
33080c7
Update `Package.resolved`.
MaximAlien Mar 16, 2022
b57defb
Fix compilation issues in `RouteController.swift`.
MaximAlien Mar 16, 2022
641bb34
Update to Mapbox Common `v21.2.0-rc.1`.
MaximAlien Mar 16, 2022
a71667f
applied new NN route parsing stage for setting a route using RouteInt…
Udumft Mar 17, 2022
5b8a020
RoutesCoordinator unit tests updated
Udumft Mar 17, 2022
cc067d2
fixed keeping unneccessary RouteController retained
Udumft Mar 17, 2022
53268bc
removed explicit main thread forcing for set routes callbacks
Udumft Mar 17, 2022
312ffe3
Updated changelog
1ec5 Mar 18, 2022
b00e325
removed parsing route in background thread
Udumft Mar 18, 2022
b033149
limited NN log level to 'info'
Udumft Mar 18, 2022
520bc89
Bumped Directions to 2.4.0.-beta.1
Udumft Mar 18, 2022
4ad728c
Depend on exact pre-release version of Directions
bamx23 Mar 18, 2022
aaaf773
Disable testPuck3DLayerPosition
bamx23 Mar 18, 2022
4f6c20c
Update CHANGELOG about version of Directions
bamx23 Mar 18, 2022
b194977
Update testLatestDescriptorsAreFromGlobalNavigatorCacheHandle
bamx23 Mar 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

## v2.4.0

### Packaging

* MapboxNavigation now requires [MapboxMaps v10.4.0-rc.1](https://github.com/mapbox/mapbox-maps-ios/releases/tag/v10.4.0-rc.1). ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))
* MapboxCoreNavigation now requires [MapboxNavigationNative v92._x_](https://github.com/mapbox/mapbox-navigation-native-ios/releases/tag/92.0.0). ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))
* MapboxCoreNavigation now requires [MapboxDirections v2.4.0-beta.1](https://github.com/mapbox/mapbox-directions-swift/releases/tag/v2.4.0-beta.1). ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))

### Location tracking

* Added the `RoadObject.Kind.railroadCrossing` enumeration case to represent a railroad crossing along the route. ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))
* Throttled requests to the Mapbox Directions API while the user moves around in a parking lot that has not been mapped in detail. ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))
* If the user backtracks from the beginning of one leg of the route to the end of the previous leg, the user is no longer considered to be off-route; instead, `RouteProgress.currentLegProgress` decrements and other properties follow suit. ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))
* Fixed a crash starting turn-by-turn navigation on some routes that included bridges and restricted-access roads. ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))

### Offline routing

* In [bilingual and multilingual areas](https://wiki.openstreetmap.org/wiki/Multilingual_names), spoken and visual instructions include street names and destinations in the user’s preferred language when that language is signposted. ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))
* Fixed `Intersection.outletIndex` values that were off by one. ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))
* High-occupancy vehicle roads in OpenStreetMap that lack a [`hov:minimum`](https://wiki.openstreetmap.org/wiki/Key:hov:minimum) tag are now assumed to be HOV 2+ roads, requiring one or more passengers. ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))
* Decreased memory usage when starting turn-by-turn navigation along a long-distance route. ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))
* Fixed an issue where street names in spoken instructions could be go unpronounced if tagged with a [pronunciation](https://wiki.openstreetmap.org/wiki/Key:name:pronunciation). ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))
* Added support for [the workaround](https://github.com/mapbox/mapbox-directions-swift/issues/662) for requesting a route that avoids an arbitrary set of coordinates. ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))

* MapboxNavigationNative now sends messages to the Unified Logging subsystem `com.mapbox` for easier filtering. ([#3765](https://github.com/mapbox/mapbox-navigation-ios/pull/3765))
1ec5 marked this conversation as resolved.
Show resolved Hide resolved

### User interface

* `FeedbackViewController` now supports changing styles based on `StyleManager`. ([#3764](https://github.com/mapbox/mapbox-navigation-ios/pull/3764))
Expand Down
6 changes: 3 additions & 3 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" ~> 21.1.0
binary "https://api.mapbox.com/downloads/v2/carthage/mobile-navigation-native/MapboxNavigationNative.xcframework.json" ~> 88.0
github "mapbox/mapbox-directions-swift" ~> 2.3
binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" == 21.2.0-rc.1
binary "https://api.mapbox.com/downloads/v2/carthage/mobile-navigation-native/MapboxNavigationNative.xcframework.json" ~> 92.0
github "mapbox/mapbox-directions-swift" == 2.4.0-beta.1
github "mapbox/mapbox-events-ios" ~> 1.0.0
8 changes: 4 additions & 4 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" "21.1.1"
binary "https://api.mapbox.com/downloads/v2/carthage/mobile-navigation-native/MapboxNavigationNative.xcframework.json" "88.0.0"
binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" "21.2.0-rc.1"
binary "https://api.mapbox.com/downloads/v2/carthage/mobile-navigation-native/MapboxNavigationNative.xcframework.json" "92.0.0"
github "Quick/Nimble" "v9.2.1"
github "Quick/Quick" "v3.1.2"
github "mapbox/mapbox-directions-swift" "v2.3.0"
github "mapbox/mapbox-directions-swift" "v2.4.0-beta.1"
github "mapbox/mapbox-events-ios" "v1.0.7"
github "mapbox/turf-swift" "v2.3.0"
github "pointfreeco/swift-snapshot-testing" "1.9.0"
github "raphaelmor/Polyline" "v5.0.2"
github "raphaelmor/Polyline" "v5.0.3"
4 changes: 2 additions & 2 deletions MapboxCoreNavigation.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ Pod::Spec.new do |s|
s.requires_arc = true
s.module_name = "MapboxCoreNavigation"

s.dependency "MapboxNavigationNative", "~> 88.0"
s.dependency "MapboxDirections", "~> 2.3"
s.dependency "MapboxNavigationNative", "~> 92.0"
s.dependency "MapboxDirections-pre", "2.4.0-beta.1"
s.dependency "MapboxMobileEvents", "~> 1.0"

s.swift_version = "5.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@
"repositoryURL": "https://github.com/mapbox/mapbox-common-ios.git",
"state": {
"branch": null,
"revision": "d0adb996dfad19ed1edc611ee640e6c7506951a0",
"version": "21.1.0"
"revision": "2a1c1a6bd3e1d0c66d384c4dfbd0a03d60f3f877",
"version": "21.2.0-rc.1"
}
},
{
"package": "MapboxCoreMaps",
"repositoryURL": "https://github.com/mapbox/mapbox-core-maps-ios.git",
"state": {
"branch": null,
"revision": "f346a9880cf92ea5e8bc15a4034bb18d3d4c079c",
"version": "10.3.2"
"revision": "c6aac72620f97c28a4475b62b050c69c3a589da1",
"version": "10.4.0-rc.1"
}
},
{
"package": "MapboxDirections",
"repositoryURL": "https://github.com/mapbox/mapbox-directions-swift.git",
"state": {
"branch": null,
"revision": "2b14b8c276523a01dc730897593990ef83c71320",
"version": "2.3.0"
"revision": "f40fcea9d26fa2cb59570f21546abeffb643a02b",
"version": "2.4.0-beta.1"
}
},
{
Expand All @@ -60,17 +60,17 @@
"repositoryURL": "https://github.com/mapbox/mapbox-maps-ios.git",
"state": {
"branch": null,
"revision": "47f9d2da9acea04e79244949328c3a9d10f39945",
"version": "10.3.0"
"revision": "8cf3f937cfd0df60fe741ce83a089296c85b2546",
"version": "10.4.0-rc.1"
}
},
{
"package": "MapboxNavigationNative",
"repositoryURL": "https://github.com/mapbox/mapbox-navigation-native-ios.git",
"state": {
"branch": null,
"revision": "921b60a08375832088d69d023c1a7e1b4cac2231",
"version": "88.0.0"
"revision": "5aae54182a7d4d829e4f458483df44cf13dcde03",
"version": "92.0.0"
}
},
{
Expand Down Expand Up @@ -114,8 +114,8 @@
"repositoryURL": "https://github.com/raphaelmor/Polyline.git",
"state": {
"branch": null,
"revision": "36f7b1222aaf8fa741d0d179c12e186998d97f42",
"version": "5.0.2"
"revision": "554a15b15ff33cf6757f4cb693c5c285fe58694e",
"version": "5.0.3"
}
},
{
Expand All @@ -141,8 +141,8 @@
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "e394bf350e38cb100b6bc4172834770ede1b7232",
"version": "1.0.3"
"revision": "82905286cc3f0fa8adc4674bf49437cab65a8373",
"version": "1.1.1"
}
},
{
Expand All @@ -159,8 +159,8 @@
"repositoryURL": "https://github.com/mapbox/turf-swift.git",
"state": {
"branch": null,
"revision": "436682278bd65a1dbfbad53902af6f4cc0af1a33",
"version": "2.2.0"
"revision": "a7db78a2281ffe79966443ebe5687766d6c024c7",
"version": "2.3.0"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion MapboxNavigation.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Pod::Spec.new do |s|
s.module_name = "MapboxNavigation"

s.dependency "MapboxCoreNavigation", "#{s.version.to_s}"
s.dependency "MapboxMaps", "~> 10.3"
s.dependency "MapboxMaps", "10.4.0-rc.1"
s.dependency "Solar-dev", "~> 3.0"
s.dependency "MapboxSpeech", "~> 2.0"
s.dependency "MapboxMobileEvents", "~> 1.0"
Expand Down
32 changes: 16 additions & 16 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@
"repositoryURL": "https://github.com/mapbox/mapbox-common-ios.git",
"state": {
"branch": null,
"revision": "d0adb996dfad19ed1edc611ee640e6c7506951a0",
"version": "21.1.0"
"revision": "2a1c1a6bd3e1d0c66d384c4dfbd0a03d60f3f877",
"version": "21.2.0-rc.1"
}
},
{
"package": "MapboxCoreMaps",
"repositoryURL": "https://github.com/mapbox/mapbox-core-maps-ios.git",
"state": {
"branch": null,
"revision": "f346a9880cf92ea5e8bc15a4034bb18d3d4c079c",
"version": "10.3.2"
"revision": "c6aac72620f97c28a4475b62b050c69c3a589da1",
"version": "10.4.0-rc.1"
}
},
{
"package": "MapboxDirections",
"repositoryURL": "https://github.com/mapbox/mapbox-directions-swift.git",
"state": {
"branch": null,
"revision": "2b14b8c276523a01dc730897593990ef83c71320",
"version": "2.3.0"
"revision": "f40fcea9d26fa2cb59570f21546abeffb643a02b",
"version": "2.4.0-beta.1"
}
},
{
Expand All @@ -60,17 +60,17 @@
"repositoryURL": "https://github.com/mapbox/mapbox-maps-ios.git",
"state": {
"branch": null,
"revision": "47f9d2da9acea04e79244949328c3a9d10f39945",
"version": "10.3.0"
"revision": "8cf3f937cfd0df60fe741ce83a089296c85b2546",
"version": "10.4.0-rc.1"
}
},
{
"package": "MapboxNavigationNative",
"repositoryURL": "https://github.com/mapbox/mapbox-navigation-native-ios.git",
"state": {
"branch": null,
"revision": "921b60a08375832088d69d023c1a7e1b4cac2231",
"version": "88.0.0"
"revision": "5aae54182a7d4d829e4f458483df44cf13dcde03",
"version": "92.0.0"
}
},
{
Expand Down Expand Up @@ -105,8 +105,8 @@
"repositoryURL": "https://github.com/raphaelmor/Polyline.git",
"state": {
"branch": null,
"revision": "36f7b1222aaf8fa741d0d179c12e186998d97f42",
"version": "5.0.2"
"revision": "554a15b15ff33cf6757f4cb693c5c285fe58694e",
"version": "5.0.3"
}
},
{
Expand All @@ -132,8 +132,8 @@
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "e394bf350e38cb100b6bc4172834770ede1b7232",
"version": "1.0.3"
"revision": "82905286cc3f0fa8adc4674bf49437cab65a8373",
"version": "1.1.1"
}
},
{
Expand All @@ -150,8 +150,8 @@
"repositoryURL": "https://github.com/mapbox/turf-swift.git",
"state": {
"branch": null,
"revision": "436682278bd65a1dbfbad53902af6f4cc0af1a33",
"version": "2.2.0"
"revision": "a7db78a2281ffe79966443ebe5687766d6c024c7",
"version": "2.3.0"
}
}
]
Expand Down
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ let package = Package(
)
],
dependencies: [
.package(name: "MapboxDirections", url: "https://github.com/mapbox/mapbox-directions-swift.git", from: "2.3.0"),
.package(name: "MapboxDirections", url: "https://github.com/mapbox/mapbox-directions-swift.git", .exact("2.4.0-beta.1")),
.package(name: "MapboxMobileEvents", url: "https://github.com/mapbox/mapbox-events-ios.git", from: "1.0.0"),
.package(name: "MapboxNavigationNative", url: "https://github.com/mapbox/mapbox-navigation-native-ios.git", from: "88.0.0"),
.package(name: "MapboxMaps", url: "https://github.com/mapbox/mapbox-maps-ios.git", from: "10.3.0"),
.package(name: "MapboxNavigationNative", url: "https://github.com/mapbox/mapbox-navigation-native-ios.git", from: "92.0.0"),
.package(name: "MapboxMaps", url: "https://github.com/mapbox/mapbox-maps-ios.git", .exact("10.4.0-rc.1")),
.package(name: "Solar", url: "https://github.com/ceeK/Solar.git", from: "3.0.0"),
.package(name: "MapboxSpeech", url: "https://github.com/mapbox/mapbox-speech-swift.git", from: "2.0.0"),
.package(name: "Quick", url: "https://github.com/Quick/Quick.git", from: "3.1.2"),
Expand Down
17 changes: 8 additions & 9 deletions Sources/MapboxCoreNavigation/CoreNavigationNavigator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class Navigator {
}

private lazy var routeCoordinator: RoutesCoordinator = {
.init(setRoutesHandler: { [weak self] routes, completion in
self?.navigator.setRoutesFor(routes) { result in
.init(setRoutesHandler: { [weak self] route, legIndex, completion in
self?.navigator.setPrimaryRouteForRoute(route, legIndex: legIndex) { [weak self] result in
if result.isValue() {
let routeInfo = result.value as! RouteInfo
os_log("Navigator has been updated",
Expand Down Expand Up @@ -209,13 +209,12 @@ class Navigator {

// MARK: - Navigator Updates

func setRoutes(_ routes: Routes?, uuid: UUID, completion: @escaping (Result<RouteInfo, Error>) -> Void) {
if let routes = routes {
routeCoordinator.beginActiveNavigation(with: routes, uuid: uuid, completion: completion)
}
else {
routeCoordinator.endActiveNavigation(with: uuid, completion: completion)
}
func setRoutes(_ route: RouteInterface, uuid: UUID, legIndex: UInt32, completion: @escaping (Result<RouteInfo, Error>) -> Void) {
routeCoordinator.beginActiveNavigation(with: route, uuid: uuid, legIndex: legIndex, completion: completion)
}

func unsetRoutes(uuid: UUID, completion: @escaping (Result<RouteInfo, Error>) -> Void) {
routeCoordinator.endActiveNavigation(with: uuid, completion: completion)
Comment on lines +216 to +217
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I broke out a separate method for unsetting the route, because more than one parameter has different expected values, and the implementation ends up being totally different.

}

func updateLocation(_ location: CLLocation, completion: @escaping (Bool) -> Void) {
Expand Down
9 changes: 9 additions & 0 deletions Sources/MapboxCoreNavigation/EHorizon/RoadObjectKind.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ extension RoadObject {
*/
case bridge

/**
An alert about an railroad crossing at grade, also known as a level crossing.
*/
case railroadCrossing

/**
Reserved for future use.
*/
Expand All @@ -76,6 +81,8 @@ extension RoadObject {
self = .restrictedArea
case .bridge:
self = .bridge
case .railwayCrossing:
self = .railroadCrossing
case .custom:
self = .userDefined
@unknown default:
Expand All @@ -99,6 +106,8 @@ extension RoadObject {
self = .restrictedArea
case .bridge:
self = .bridge
case .railwayCrossing:
self = .railroadCrossing
case .custom:
self = .userDefined
@unknown default:
Expand Down
40 changes: 26 additions & 14 deletions Sources/MapboxCoreNavigation/MapboxRoutingProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -295,33 +295,45 @@ public class MapboxRoutingProvider: RoutingProvider {
return nil
}

let encoder = JSONEncoder()
encoder.userInfo[.options] = routeOptions

let routeIndex = UInt32(indexedRouteResponse.routeIndex)

guard let routeData = try? encoder.encode(indexedRouteResponse.routeResponse),
let routeJSONString = String(data: routeData, encoding: .utf8) else {
preconditionFailure("Could not serialize route data for refreshing.")
}

var requestId: RequestId!
let refreshOptions = RouteRefreshOptions(requestId: responseIdentifier,
routeIndex: routeIndex,
legIndex: startLegIndex,
routingProfile: routeOptions.profileIdentifier.nativeProfile)

requestId = router.getRouteRefresh(for: refreshOptions,
route: routeJSONString) { [weak self] result, _ in
requestId = router.getRouteRefresh(for: refreshOptions, callback: { [weak self] result, _ in
guard let self = self else { return }

self.parseResponse(requestId: requestId,
userInfo: [.options: routeOptions,
userInfo: [.responseIdentifier: responseIdentifier,
.routeIndex: indexedRouteResponse.routeIndex,
.startLegIndex: Int(startLegIndex),
.credentials: self.settings.directions.credentials],
result: result) { (response: Result<RouteResponse, DirectionsError>) in
completionHandler(session, response)
result: result) { (response: Result<RouteRefreshResponse, DirectionsError>) in
switch response {
case .failure(let error):
DispatchQueue.main.async {
completionHandler(session, .failure(error))
}
case .success(let routeRefreshResponse):
DispatchQueue.global().async {
do {
let routeResponse = try indexedRouteResponse.routeResponse.copy(with: routeOptions)
routeResponse.routes?[indexedRouteResponse.routeIndex].refreshLegAttributes(from: routeRefreshResponse.route)
DispatchQueue.main.async {
completionHandler(session, .success(routeResponse))
}
} catch {
DispatchQueue.main.async {
completionHandler(session, .failure(.unknown(response: nil, underlying: error, code: nil, message: nil)))
}
}
}
}
}
}
})
let request = Request(requestIdentifier: requestId,
routingProvider: self)
requestsLock {
Expand Down
Loading