Skip to content

Commit c74ef15

Browse files
Upgrade dependencies (#4085)
* Upgrade dependencies. * Update package.resolved. * Update links in changelog. * Add isUrban flags. * Incorporate feedback. * Fix RoadObject.isUrban comment. * Update changelog. * Add convenience initializers for RoadObject and Edge Metadata for isUrban property. * Add doc comments to convenience inits. * Upgrade directions version. * Add direction changes to changelog. * Add default value to isUrban properties. * Fix initializers for RoadObject and EdgeMetadata. * Remove convenience from struct inits.
1 parent e7eefe0 commit c74ef15

File tree

12 files changed

+134
-55
lines changed

12 files changed

+134
-55
lines changed

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,47 @@
22

33
## main
44

5+
### Packaging
6+
* MapboxNavigation now requires [MapboxMaps v10.8._x_](https://github.com/mapbox/mapbox-maps-ios/releases/tag/v10.8.0-beta.1). ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
7+
* MapboxCoreNavigation now requires [MapboxNavigationNative v112._x_](https://github.com/mapbox/mapbox-navigation-native-ios/releases/tag/112.0.0). ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
8+
* MapboxCoreNavigation now requires [MapboxDirections v2.7.0-beta.1](https://github.com/mapbox/mapbox-directions-swift/releases/tag/v2.7.0-beta.1). ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
9+
510
### Location Tracking
611

712
* Added `customActivityType` to `MapboxNavigationService` initialization to allow overriding default activity type for location updates during this navigation session. Changed default activity type from `automotiveNavigation` to `otherNavigation` for `.automobile` and `.automobileAvoidingTraffic` profiles. ([#4068](https://github.com/mapbox/mapbox-navigation-ios/pull/4068))
813
* Added `NavigationSettings.navigatorPredictionInterval` to control how far ahead Navigator will predict user current position. ([#4072](https://github.com/mapbox/mapbox-navigation-ios/pull/4072))
14+
* Added the `RoadGraph.Edge.Metadata.isUrban` and `RoadObject.isUrban` properties and accompanying convenience initializers to indicate whether the edge or road object is in an urban area. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
15+
* Fixed an issue where some incidents in Japan were associated with two disconnected road edges, causing the `RoadGraph.Path` in `RoadObject.Location.openLRLine(path:shape:)` to have the wrong `RoadGraph.Path.edgeIdentifiers`. ([valhalla/valhalla#3667](https://github.com/valhalla/valhalla/issues/3667), [#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
916

1017
### Map
1118

1219
* Fixed an issue where the route line layer appears above point of interest labels. ([#4062](https://github.com/mapbox/mapbox-navigation-ios/pull/4062))
20+
* Fixed an issue where the destination building failed to highlight if the user has gotten rerouted at any time during the trip. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
21+
* Fixed an issue where the map would cut off a continuous alternative route to appear as if it began after the deviation point. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
22+
* Fixed an issue where the callout annotating a continuous alternative route appeared far away from the route and contained an inaccurate travel time. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
23+
* Fixed an issue where some roads were shown as restricted on the route line even if public access is allowed for “local traffic only”. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
24+
25+
### Guidance Instructions
26+
* Fixed an issue where the top banner and current road name label represented Mexican state highways with generic shields. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
27+
* Fixed an issue where the route would instruct the user to make a “U-turn” toward the passenger side wherever the user should actually make two successive turns toward the passenger side or take an exit ramp that curves 180°. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
28+
* `JunctionView` now appears after passing some toll booths or electronic toll collection points in Japan. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
29+
* Improved the pronunciation of junction names in Japanese in Japan. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
30+
* At a fork or exit on an expressway in Japan, spoken instructions now mention the junction name and side of the road but no longer mention the expressway name or number that the user would stay on. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
31+
* Fixed confusing instructions to take the roundabout in the Russian localization. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
32+
33+
### Routing
34+
35+
* After a fork in the road, if the user takes a different road than expected, RouteController now recognizes the actual road the user took more quickly than before. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
36+
* Fixed an issue where a route would U-turn outside the destination parking lot, avoiding a more direct parking lot entrance. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
37+
* If `RouteOptions.departAt` or `RouteOptions.arriveBy` is set, the resulting route now respects turn restrictions that depend on the date or time. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
38+
* Eliminated the time penalty that was applied to barriers such as gates and border crossings, which was redundant to the effective time penalty from predicted speeds around the barrier. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
39+
* A multi-leg route that crosses an international border can now have alternative routes. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
40+
* Curvy roads are penalized slightly more consistently. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
41+
* You can now set `Waypoint.allowsSnappingToStaticallyClosedRoad` to `true` to allow the waypoint to snap to a road that is fully closed for long-term construction. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
42+
43+
### Other changes
44+
45+
* When launching the application, any stray files left over from old canceled offline tile downloads are cleaned up automatically to save storage space. ([#4085](https://github.com/mapbox/mapbox-navigation-ios/pull/4085))
1346

1447
## 2.7.0
1548

Cartfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" ~> 22.1.0
2-
binary "https://api.mapbox.com/downloads/v2/carthage/mobile-navigation-native/MapboxNavigationNative.xcframework.json" ~> 111.0
3-
github "mapbox/mapbox-directions-swift" ~> 2.6
1+
binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" == 23.0.0-beta.1
2+
binary "https://api.mapbox.com/downloads/v2/carthage/mobile-navigation-native/MapboxNavigationNative.xcframework.json" ~> 112.0
3+
github "mapbox/mapbox-directions-swift" == 2.7.0-beta.1
44
github "mapbox/mapbox-events-ios" ~> 1.0.0

Cartfile.resolved

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" "22.1.0"
2-
binary "https://api.mapbox.com/downloads/v2/carthage/mobile-navigation-native/MapboxNavigationNative.xcframework.json" "111.0.1"
1+
binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" "23.0.0-beta.1"
2+
binary "https://api.mapbox.com/downloads/v2/carthage/mobile-navigation-native/MapboxNavigationNative.xcframework.json" "112.0.0"
33
github "Quick/Nimble" "v9.2.1"
44
github "Quick/Quick" "v3.1.2"
5-
github "mapbox/mapbox-directions-swift" "v2.6.0"
5+
github "mapbox/mapbox-directions-swift" "v2.7.0-beta.1"
66
github "mapbox/mapbox-events-ios" "v1.0.8"
77
github "mapbox/turf-swift" "v2.5.0"
88
github "pointfreeco/swift-snapshot-testing" "1.9.0"

MapboxCoreNavigation.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ Pod::Spec.new do |s|
4040
s.requires_arc = true
4141
s.module_name = "MapboxCoreNavigation"
4242

43-
s.dependency "MapboxNavigationNative", "~> 111.0"
44-
s.dependency "MapboxDirections", "~> 2.6"
43+
s.dependency "MapboxNavigationNative", "~> 112.0"
44+
s.dependency "MapboxDirections-pre", "2.7.0-beta.1"
4545
s.dependency "MapboxMobileEvents", "~> 1.0"
4646

4747
s.swift_version = "5.0"

MapboxNavigation-SPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MapboxNavigation.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Pod::Spec.new do |s|
4444
s.module_name = "MapboxNavigation"
4545

4646
s.dependency "MapboxCoreNavigation", "#{s.version.to_s}"
47-
s.dependency "MapboxMaps", "~> 10.7.0"
47+
s.dependency "MapboxMaps", "10.8.0-beta.1"
4848
s.dependency "Solar-dev", "~> 3.0"
4949
s.dependency "MapboxSpeech", "~> 2.0"
5050
s.dependency "MapboxMobileEvents", "~> 1.0"

Package.resolved

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ let package = Package(
2222
)
2323
],
2424
dependencies: [
25-
.package(name: "MapboxDirections", url: "https://github.com/mapbox/mapbox-directions-swift.git", from: "2.6.0"),
25+
.package(name: "MapboxDirections", url: "https://github.com/mapbox/mapbox-directions-swift.git", .exact("2.7.0-beta.1")),
2626
.package(name: "MapboxMobileEvents", url: "https://github.com/mapbox/mapbox-events-ios.git", from: "1.0.0"),
27-
.package(name: "MapboxNavigationNative", url: "https://github.com/mapbox/mapbox-navigation-native-ios.git", from: "111.0.0"),
28-
.package(name: "MapboxMaps", url: "https://github.com/mapbox/mapbox-maps-ios.git", from: "10.7.0"),
27+
.package(name: "MapboxNavigationNative", url: "https://github.com/mapbox/mapbox-navigation-native-ios.git", from: "112.0.0"),
28+
.package(name: "MapboxMaps", url: "https://github.com/mapbox/mapbox-maps-ios.git", .exact("10.8.0-beta.1")),
2929
.package(name: "Solar", url: "https://github.com/ceeK/Solar.git", from: "3.0.0"),
3030
.package(name: "MapboxSpeech", url: "https://github.com/mapbox/mapbox-speech-swift.git", from: "2.0.0"),
3131
.package(name: "Quick", url: "https://github.com/Quick/Quick.git", from: "3.1.2"),

Sources/MapboxCoreNavigation/EHorizon/RoadGraphEdgeMetadata.swift

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ extension RoadGraph.Edge {
7373
/** The number of parallel traffic lanes along the edge. */
7474
public let laneCount: UInt?
7575

76+
/** `True` if edge is considered to be in an urban area, `false` otherwise. */
77+
public let isUrban: Bool
78+
7679
/**
7780
Initializes a new edge `Metadata` object.
7881
*/
@@ -90,7 +93,8 @@ extension RoadGraph.Edge {
9093
countryCode: String?,
9194
regionCode: String?,
9295
drivingSide: DrivingSide,
93-
directionality: Directionality) {
96+
directionality: Directionality,
97+
isUrban: Bool) {
9498
self.heading = heading
9599
self.length = length
96100
self.roadClasses = roadClasses
@@ -106,6 +110,28 @@ extension RoadGraph.Edge {
106110
self.regionCode = regionCode
107111
self.drivingSide = drivingSide
108112
self.directionality = directionality
113+
self.isUrban = isUrban
114+
}
115+
116+
/**
117+
Initializes a new edge `Metadata` object.
118+
*/
119+
init(heading: CLLocationDegrees,
120+
length: CLLocationDistance,
121+
roadClasses: RoadClasses,
122+
mapboxStreetsRoadClass: MapboxStreetsRoadClass,
123+
speedLimit: Measurement<UnitSpeed>?,
124+
speed: CLLocationSpeed,
125+
isBridge: Bool,
126+
names: [RoadName],
127+
laneCount: UInt?,
128+
altitude: CLLocationDistance?,
129+
curvature: UInt,
130+
countryCode: String?,
131+
regionCode: String?,
132+
drivingSide: DrivingSide,
133+
directionality: Directionality) {
134+
self.init(heading: heading, length: length, roadClasses: roadClasses, mapboxStreetsRoadClass: mapboxStreetsRoadClass, speedLimit: speedLimit, speed: speed, isBridge: isBridge, names: names, laneCount: laneCount, altitude: altitude, curvature: curvature, countryCode: countryCode, regionCode: regionCode, drivingSide: drivingSide, directionality: directionality, isUrban: false)
109135
}
110136

111137
init(_ native: EdgeMetadata) {
@@ -142,6 +168,7 @@ extension RoadGraph.Edge {
142168
regionCode = native.stateCode
143169
drivingSide = native.isIsRightHandTraffic ? .right : .left
144170
directionality = native.isIsOneway ? .oneWay : .bothWays
171+
isUrban = native.isIsUrban
145172
}
146173
}
147174
}

Sources/MapboxCoreNavigation/EHorizon/RoadObject.swift

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ public struct RoadObject {
2525

2626
/** `true` if an object is added by user, `false` if it comes from Mapbox service. */
2727
public let isUserDefined: Bool
28+
29+
/**
30+
Indicates whether the road object is located in an urban area.
31+
This property is set to `nil` if the road object comes from a call to the `RoadObjectStore.roadObject(identifier:)` method and `location` is set to `RoadObject.Location.point(_:)`.
32+
*/
33+
public let isUrban: Bool?
2834

2935
let native: MapboxNavigationNative.RoadObject?
3036

@@ -34,21 +40,34 @@ public struct RoadObject {
3440
public init(identifier: RoadObject.Identifier,
3541
length: CLLocationDistance?,
3642
location: RoadObject.Location,
37-
kind: RoadObject.Kind) {
43+
kind: RoadObject.Kind,
44+
isUrban: Bool?) {
3845
self.identifier = identifier
3946
self.length = length
4047
self.location = location
4148
self.kind = kind
4249
isUserDefined = true
50+
self.isUrban = isUrban
4351
native = nil
4452
}
53+
54+
/**
55+
Initializes a new `RoadObject` object.
56+
*/
57+
init(identifier: RoadObject.Identifier,
58+
length: CLLocationDistance?,
59+
location: RoadObject.Location,
60+
kind: RoadObject.Kind) {
61+
self.init(identifier: identifier, length: length, location: location, kind: kind, isUrban: nil)
62+
}
4563

4664
init(_ native: MapboxNavigationNative.RoadObject) {
4765
identifier = native.id
4866
length = native.length?.doubleValue
4967
location = RoadObject.Location(native.location)
5068
kind = RoadObject.Kind(type: native.type, metadata: native.metadata)
5169
isUserDefined = native.provider == .custom
70+
isUrban = native.isUrban?.boolValue
5271
self.native = native
5372
}
5473
}

0 commit comments

Comments
 (0)