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

Excluding cash tolls roads fix #801

Merged
merged 2 commits into from
Feb 24, 2023
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Added `Matrix` API wrapper. The [Mapbox Matrix API](https://docs.mapbox.com/api/navigation/matrix/) computes travel times between many points, and returns a matrix of all travel times between the locations. [#626](https://github.com/mapbox/mapbox-directions-swift/pull/626)
* Fixed a crash that could occur if only one `Waypoint` with a nonnull `name` was used in the Directions request. [#797](https://github.com/mapbox/mapbox-directions-swift/pull/797)
* Added `Interchange` and `Junction` structs describing IC and JCT. [#799](https://github.com/mapbox/mapbox-directions-swift/pull/799)
* Fixed an issue where using `cashTollOnly` for road class exclusions failed the directions request. ([#801](https://github.com/mapbox/mapbox-directions-swift/pull/801))

## v2.9.0

Expand Down
4 changes: 2 additions & 2 deletions Sources/MapboxDirections/RoadClasses.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public struct RoadClasses: OptionSet, CustomStringConvertible {
roadClasses.insert(.highOccupancyToll)
case "unpaved":
roadClasses.insert(.unpaved)
case "cash_only_toll":
case "cash_only_tolls":
roadClasses.insert(.cashTollOnly)
case "":
continue
Expand Down Expand Up @@ -162,7 +162,7 @@ public struct RoadClasses: OptionSet, CustomStringConvertible {
descriptions.append("unpaved")
}
if contains(.cashTollOnly) {
descriptions.append("cash_only_toll")
descriptions.append("cash_only_tolls")
}
return descriptions.joined(separator: ",")
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/MapboxDirectionsTests/RouteOptionsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ class RouteOptionsTests: XCTestCase {
options.roadClassesToAvoid = [.toll, .motorway, .ferry, .unpaved, .cashTollOnly]
options.roadClassesToAllow = [.highOccupancyVehicle2, .highOccupancyVehicle3, .highOccupancyToll]

let expectedExcludeQueryItem = URLQueryItem(name: "exclude", value: "toll,motorway,ferry,unpaved,cash_only_toll")
let expectedExcludeQueryItem = URLQueryItem(name: "exclude", value: "toll,motorway,ferry,unpaved,cash_only_tolls")
XCTAssertTrue(options.urlQueryItems.contains(expectedExcludeQueryItem))

let expectedIncludeQueryItem = URLQueryItem(name: "include", value: "hov2,hov3,hot")
Expand Down