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

MapboxNavigationNative v9.0.4 #2319

Merged
merged 2 commits into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@
* Removed `RouteLegProgress.upComingStep` in favor of `RouteLegProgress.upcomingStep`. ([#2297](https://github.com/mapbox/mapbox-navigation-ios/pull/2297))
* Removed the `RouteProgress.nearbyCoordinates` property in favor of `RouteProgress.nearbyShape`. ([#2275](https://github.com/mapbox/mapbox-navigation-ios/pull/2275), [#2275](https://github.com/mapbox/mapbox-navigation-ios/pull/2275))
* Removed the `LegacyRouteController.tunnelIntersectionManager` property. ([#2297](https://github.com/mapbox/mapbox-navigation-ios/pull/2297))
* Improved the accuracy of location tracking and off-route detection. ([#2319](https://github.com/mapbox/mapbox-navigation-ios/pull/2319))
* Fixed an issue where location tracking would pause at the beginning of a route after setting `RouteOptions.shapeFormat` to `RouteShapeFormat.polyline` or `RouteShapeFormat.geoJSON`. Note that you most likely do not need to override the default value of `RouteShapeFormat.polyline6`: this is the least bandwidth-intensive format, and `Route.shape` and `RouteStep.shape` are set to `LineString`s regardless. ([#2319](https://github.com/mapbox/mapbox-navigation-ios/pull/2319))

### Offline navigation

* Fixed a crash that occurred after setting `RouteOptions.shapeFormat` to `RouteShapeFormat.geoJSON`. ([valhalla/valhalla#1867](https://github.com/valhalla/valhalla/pull/1867))
* Fixed issues where routes would sometimes require divebombing. ([valhalla/valhalla#1931](https://github.com/valhalla/valhalla/pull/1931))
* Fixed an issue where the route would sometimes contain duplicate waypoints. ([valhalla/valhalla#1880](https://github.com/valhalla/valhalla/pull/1880))
* Turn lane indications are now shown below the turn banner as when navigating online. ([valhalla/valhalla#1830](https://github.com/valhalla/valhalla/pull/1830), [valhalla/valhalla#1859](https://github.com/valhalla/valhalla/pull/1859))
* Suppressed extraneous fork instructions. ([valhalla/valhalla#1886](https://github.com/valhalla/valhalla/pull/1886), [valhalla/valhalla#1909](https://github.com/valhalla/valhalla/pull/1909), [valhalla/valhalla#1928](https://github.com/valhalla/valhalla/pull/1928))
* Merge instructions now indicate whether to merge to the left or the right, as when navigating online. ([valhalla/valhalla#1892](https://github.com/valhalla/valhalla/pull/1892), [valhalla/valhalla#1989](https://github.com/valhalla/valhalla/pull/1989))
* Fixed an issue where spoken and visual instructions sometimes omitted the cardinal direction after a route number in the United States. ([valhalla/valhalla#1917](https://github.com/valhalla/valhalla/pull/1917))
* A spoken instruction about an exit ramp no longer specifies the side of the road if the ramp branches off the slow lane (on the right side in regions that drive on the right). ([valhalla/valhalla#1990](https://github.com/valhalla/valhalla/pull/1990))

### Other changes
* Various delegate protocols now provide default no-op implementations for all their methods and conform to the `UnimplementedLogging` protocol, which can inform you at runtime when a delegate method is called but has not been implemented. This replaces the use of optional methods, which are disallowed in pure Swift protocols. Messages are sent through Apple Unified Logging and can be disabled globally through [Unifed Logging](https://developer.apple.com/documentation/os/logging#2878594), or by overriding the delegate function with a no-op implementation. ([#2230](https://github.com/mapbox/mapbox-navigation-ios/pull/2230))
Expand Down
4 changes: 2 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
binary "https://www.mapbox.com/ios-sdk/MapboxAccounts.json" ~> 2.2
binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" ~> 5.6
binary "https://www.mapbox.com/ios-sdk/MapboxNavigationNative.json" ~> 6.2.1
github "mapbox/mapbox-directions-swift" ~> 0.31
binary "https://www.mapbox.com/ios-sdk/MapboxNavigationNative.json" ~> 9.0.3
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pinned to v9.0.4 specifically in 5cae87d and aa149ed, because v9.2.1 is available and not backwards-compatible. Compatibility with v9.2.1 would require a bit of work, but we’re doing that anyways as part of upgrading to v13.x.

/cc @mapbox/navnative

github "mapbox/mapbox-directions-swift" == 1.0.0-alpha.1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should’ve remained v0.31. Looks like a rebase incorrectly changed it back to v1.0.0-alpha.1. Fixed in c3dda00.

github "mapbox/turf-swift" ~> 0.3
github "mapbox/mapbox-events-ios" ~> 0.10
github "ceeK/Solar" ~> 2.1.0
Expand Down
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" "5.9.0"
binary "https://www.mapbox.com/ios-sdk/MapboxAccounts.json" "2.2.0"
binary "https://www.mapbox.com/ios-sdk/MapboxNavigationNative.json" "6.2.1"
binary "https://www.mapbox.com/ios-sdk/MapboxNavigationNative.json" "9.0.4"
github "CedarBDD/Cedar" "v1.0"
github "Quick/Nimble" "v8.0.9"
github "Quick/Quick" "v2.2.0"
Expand Down
2 changes: 1 addition & 1 deletion MapboxCoreNavigation.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Pod::Spec.new do |s|
s.requires_arc = true
s.module_name = "MapboxCoreNavigation"

s.dependency "MapboxNavigationNative", "~> 6.2.1"
s.dependency "MapboxNavigationNative", "~> 9.0.3"
s.dependency "MapboxAccounts", "~> 2.2.0"
s.dependency "MapboxDirections", "~> 0.31.0"
s.dependency "MapboxMobileEvents", "~> 0.10.2" # Always pin to a patch release if pre-1.0
Expand Down
2 changes: 1 addition & 1 deletion MapboxCoreNavigation/CLLocation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension CLLocation {
return locationDictionary
}

convenience init(_ location: MBFixLocation) {
convenience init(_ location: FixLocation) {
self.init(coordinate: location.coordinate,
altitude: location.altitude?.doubleValue ?? 0,
horizontalAccuracy: location.accuracyHorizontal?.doubleValue ?? -1,
Expand Down
2 changes: 1 addition & 1 deletion MapboxCoreNavigation/MBNavigator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation
import MapboxNavigationNative
import CoreLocation

extension MBFixLocation {
extension FixLocation {
convenience init(_ location: CLLocation) {
self.init(coordinate: location.coordinate,
time: location.timestamp,
Expand Down
11 changes: 6 additions & 5 deletions MapboxCoreNavigation/OfflineDirections.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ public class NavigationDirections: Directions {
*/
public func configureRouter(tilesURL: URL, completionHandler: @escaping NavigationDirectionsCompletionHandler) {
NavigationDirectionsConstants.offlineSerialQueue.sync {
let tileCount = self.navigator.configureRouter(forTilesPath: tilesURL.path)
let params = RouterParams(tilesPath: tilesURL.path, inMemoryTileCache: nil, mapMatchingSpatialCache: nil, threadsCount: nil, endpointConfig: nil)
let tileCount = self.navigator.configureRouter(for: params, httpInterface: nil)
DispatchQueue.main.async {
completionHandler(tileCount)
}
Expand Down Expand Up @@ -151,7 +152,7 @@ public class NavigationDirections: Directions {
let tilePath = filePathURL.path
let outputPath = outputDirectoryURL.path

let numberOfTiles = MBNavigator().unpackTiles(forPacked_tiles_path: tilePath, output_directory: outputPath)
let numberOfTiles = Navigator().unpackTiles(forPackedTilesPath: tilePath, outputDirectory: outputPath)

// Report 100% progress
progressHandler?(totalPackedBytes, totalPackedBytes)
Expand Down Expand Up @@ -228,13 +229,13 @@ public class NavigationDirections: Directions {
}
}

var _navigator: MBNavigator!
var navigator: MBNavigator {
var _navigator: Navigator!
var navigator: Navigator {
assert(currentQueueName() == NavigationDirectionsConstants.offlineSerialQueueLabel,
"The offline navigator must be accessed from the dedicated serial queue")

if _navigator == nil {
self._navigator = MBNavigator()
self._navigator = Navigator()
}

return _navigator
Expand Down
16 changes: 8 additions & 8 deletions MapboxCoreNavigation/RouteController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ open class RouteController: NSObject {
public static let shouldDisableBatteryMonitoring: Bool = true
}

let navigator = MBNavigator()
let navigator = Navigator()

public var route: Route {
get {
Expand Down Expand Up @@ -60,7 +60,7 @@ open class RouteController: NSObject {

var isFirstLocation: Bool = true

public var config: MBNavigatorConfig? {
public var config: NavigatorConfig? {
get {
return navigator.getConfig()
}
Expand Down Expand Up @@ -196,7 +196,7 @@ open class RouteController: NSObject {

rawLocation = locations.last

locations.forEach { navigator.updateLocation(for: MBFixLocation($0)) }
locations.forEach { navigator.updateLocation(for: FixLocation($0)) }

let status = navigator.getStatusForTimestamp(location.timestamp)

Expand All @@ -219,7 +219,7 @@ open class RouteController: NSObject {
checkForFasterRoute(from: location, routeProgress: routeProgress)
}

func updateIndexes(status: MBNavigationStatus, progress: RouteProgress) {
func updateIndexes(status: NavigationStatus, progress: RouteProgress) {
let newLegIndex = Int(status.legIndex)
let newStepIndex = Int(status.stepIndex)
let newIntersectionIndex = Int(status.intersectionIndex)
Expand All @@ -245,7 +245,7 @@ open class RouteController: NSObject {
}
}

func updateSpokenInstructionProgress(status: MBNavigationStatus, willReRoute: Bool) {
func updateSpokenInstructionProgress(status: NavigationStatus, willReRoute: Bool) {
let didUpdate = status.voiceInstruction?.index != nil

// Announce voice instruction if it was updated and we are not going to reroute
Expand All @@ -255,7 +255,7 @@ open class RouteController: NSObject {
}
}

func updateVisualInstructionProgress(status: MBNavigationStatus) {
func updateVisualInstructionProgress(status: NavigationStatus) {
let didUpdate = status.bannerInstruction != nil

// Announce visual instruction if it was updated or it is the first location being reported
Expand All @@ -266,7 +266,7 @@ open class RouteController: NSObject {
}
}

func updateRouteLegProgress(status: MBNavigationStatus) {
func updateRouteLegProgress(status: NavigationStatus) {
let legProgress = routeProgress.currentLegProgress

guard let currentDestination = legProgress.leg.destination else {
Expand Down Expand Up @@ -374,7 +374,7 @@ extension RouteController: Router {
return userIsOnRoute(location, status: nil)
}

public func userIsOnRoute(_ location: CLLocation, status: MBNavigationStatus?) -> Bool {
public func userIsOnRoute(_ location: CLLocation, status: NavigationStatus?) -> Bool {

guard let destination = routeProgress.currentLeg.destination else {
preconditionFailure("Route legs used for navigation must have destinations")
Expand Down
6 changes: 3 additions & 3 deletions MapboxCoreNavigationTests/CLLocationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CLLocationTests: XCTestCase {
let altitude: CLLocationDistance = 10
let horizontalAccuracy: CLLocationAccuracy = 50

let fixLocation = MBFixLocation(coordinate: coordinate, time: timestamp,
let fixLocation = FixLocation(coordinate: coordinate, time: timestamp,
speed: speed as NSNumber, bearing: bearing as NSNumber,
altitude: altitude as NSNumber, accuracyHorizontal: horizontalAccuracy as NSNumber, provider: nil)

Expand Down Expand Up @@ -48,7 +48,7 @@ class CLLocationTests: XCTestCase {
speed: -1,
timestamp: now)

let fixLocation = MBFixLocation(location)
let fixLocation = FixLocation(location)

XCTAssertEqual(fixLocation.coordinate.latitude, coordinate.latitude)
XCTAssertEqual(fixLocation.coordinate.longitude, coordinate.longitude)
Expand All @@ -62,7 +62,7 @@ class CLLocationTests: XCTestCase {
func testMBFixLocationToCLLocation() {
let coordinate = CLLocationCoordinate2D(latitude: 1, longitude: 2)
let now = Date()
let fixLocation = MBFixLocation(coordinate: coordinate,
let fixLocation = FixLocation(coordinate: coordinate,
time: now,
speed: nil,
bearing: nil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@
"${BUILT_PRODUCTS_DIR}/MapboxNavigation/MapboxNavigation.framework",
"${PODS_ROOT}/MapboxNavigationNative/MapboxNavigationNative.framework",
"${PODS_ROOT}/MapboxNavigationNative/MapboxNavigationNative.framework.dSYM",
"${PODS_ROOT}/MapboxNavigationNative/AD9491ED-E39E-3A31-9219-CB1BE55C9557.bcsymbolmap",
"${PODS_ROOT}/MapboxNavigationNative/D821D29D-8C15-3A60-A2CB-DE30ED690192.bcsymbolmap",
"${BUILT_PRODUCTS_DIR}/MapboxSpeech/MapboxSpeech.framework",
"${BUILT_PRODUCTS_DIR}/Polyline/Polyline.framework",
"${BUILT_PRODUCTS_DIR}/Solar/Solar.framework",
Expand All @@ -264,6 +266,8 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxNavigation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxNavigationNative.framework",
"${DWARF_DSYM_FOLDER_PATH}/MapboxNavigationNative.framework.dSYM",
"${BUILT_PRODUCTS_DIR}/AD9491ED-E39E-3A31-9219-CB1BE55C9557.bcsymbolmap",
"${BUILT_PRODUCTS_DIR}/D821D29D-8C15-3A60-A2CB-DE30ED690192.bcsymbolmap",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxSpeech.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Polyline.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Solar.framework",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PODS:
- MapboxAccounts (~> 2.2.0)
- MapboxDirections (~> 0.31.0)
- MapboxMobileEvents (~> 0.10.2)
- MapboxNavigationNative (~> 6.2.1)
- MapboxNavigationNative (~> 9.0.3)
- Turf (~> 0.3.0)
- MapboxDirections (0.31.0):
- Polyline (~> 4.2)
Expand All @@ -17,7 +17,7 @@ PODS:
- MapboxCoreNavigation (= 1.0.0-alpha.1)
- MapboxSpeech (~> 0.3.0)
- Solar (~> 2.1)
- MapboxNavigationNative (6.2.1)
- MapboxNavigationNative (9.0.3)
- MapboxSpeech (0.3.0)
- Polyline (4.2.1)
- Solar (2.1.0)
Expand Down Expand Up @@ -48,11 +48,11 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Mapbox-iOS-SDK: a5915700ec84bc1a7f8b3e746d474789e35b7956
MapboxAccounts: 3c04a1df56c1ac4ff714619296fb47310cf70ad0
MapboxCoreNavigation: 3c366260f5b92318f7d2907f8adbbf950a9da726
MapboxCoreNavigation: 77d1f40d6cc5441d49623a0eaf4d20cab4690839
MapboxDirections: 0b97aa320d7cddbe72d6513becc07dd747935240
MapboxMobileEvents: 2bc0ca2eedb627b73cf403258dce2b2fa98074a6
MapboxNavigation: b8bf681a7df49783e977a423c0d8a73d5f1b82f8
MapboxNavigationNative: 11dc22140f4698d3f26989f2b6379dc81ef0d4c1
MapboxNavigationNative: 22610b4b439d8c2d49a3d7c827011d3930489bca
MapboxSpeech: 403415e932e084cf290b9d55c49ab7ea210b9595
Polyline: 0e9890790292741c8186201a536b6bb6a78d02dd
Solar: 2dc6e7cc39186cb0c8228fa08df76fb50c7d8f24
Expand Down
Loading