Skip to content

Commit

Permalink
Add tunnel RoadClass (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobby Sudekum committed Jan 26, 2018
1 parent 5aeaddf commit 8ea5ad5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MapboxDirections/MBRoadClasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ typedef NS_OPTIONS(NSUInteger, MBRoadClasses) {
In general, the transport type of the step containing the road segment is also `TransportType.ferry`.
*/
MBRoadClassesFerry = (1 << 4),

/**
The user must travel this segment of the route through a [tunnel](https://wiki.openstreetmap.org/wiki/Key:tunnel).
*/
MBRoadClassesTunnel = (1 << 5),
};
5 changes: 5 additions & 0 deletions MapboxDirections/MBRoadClasses.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ extension RoadClasses: CustomStringConvertible {
roadClasses.insert(.motorway)
case "ferry":
roadClasses.insert(.ferry)
case "tunnel":
roadClasses.insert(.tunnel)
case "none":
break
default:
Expand Down Expand Up @@ -46,6 +48,9 @@ extension RoadClasses: CustomStringConvertible {
if contains(.ferry) {
descriptions.append("ferry")
}
if contains(.tunnel) {
descriptions.append("tunnel")
}
return descriptions.joined(separator: ",")
}
}

0 comments on commit 8ea5ad5

Please sign in to comment.