-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #222 from mapbox/jerrad/osrm-name-nil
Mapbox Directions API OSRM Name Fix
- Loading branch information
Showing
7 changed files
with
96 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Foundation | ||
|
||
extension String { | ||
var nonEmptyString: String? { | ||
return !isEmpty ? self : nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
MapboxDirectionsTests/Fixtures/Responses/apiDestinationName.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"routes":[{"geometry":"afvnFdrebO@o@xT~@hAx@bAfAK\\c@]","legs":[{"summary":"Reading Road, Reading Road","weight":143.6,"duration":73.2,"steps":[{"intersections":[{"out":0,"entry":[true],"bearings":[95],"location":[-84.411389,39.27665]}],"driving_side":"right","geometry":"afvnFdrebO@o@","mode":"driving","maneuver":{"bearing_after":95,"bearing_before":0,"location":[-84.411389,39.27665],"type":"depart","instruction":"Head east on Hageman Street"},"weight":11.8,"duration":6.8,"name":"Hageman Street","distance":20.8},{"intersections":[{"out":1,"in":2,"entry":[true,true,false],"bearings":[0,180,270],"location":[-84.411148,39.276635]},{"out":2,"in":0,"entry":[false,false,true],"bearings":[0,30,180],"location":[-84.411372,39.274088]},{"out":1,"in":0,"entry":[false,true,true],"bearings":[0,180,270],"location":[-84.411386,39.273937]},{"out":2,"in":0,"entry":[false,true,true],"bearings":[0,30,180],"location":[-84.411401,39.273772]}],"driving_side":"right","geometry":"_fvnFtpebO`DJP@ZBvFTt@B\\B`@@fAFr@D","mode":"driving","maneuver":{"bearing_after":182,"bearing_before":94,"location":[-84.411148,39.276635],"modifier":"right","type":"turn","instruction":"Turn right onto Reading Road"},"weight":41.49999999999999,"pronunciation":"ˈrɛdɪŋ ˈɹoʊd","duration":36.4,"name":"Reading Road","distance":388.5},{"distance":97.7,"name":"Reading Road (US 42)","pronunciation":"ˈrɛdɪŋ ˈɹoʊd","ref":"US 42","maneuver":{"bearing_after":209,"bearing_before":184,"location":[-84.411469,39.273151],"modifier":"slight right","type":"continue","instruction":"Make a slight right to stay on Reading Road (US 42)"},"weight":13.6,"mode":"driving","geometry":"epunFtrebOXPLJHFJHJHVVFHb@d@","intersections":[{"out":2,"in":0,"entry":[false,true,true],"bearings":[0,180,210],"location":[-84.411469,39.273151]},{"out":2,"in":0,"entry":[false,false,true],"bearings":[30,75,210],"location":[-84.411756,39.27278]},{"out":2,"in":0,"entry":[false,false,true],"bearings":[30,75,225],"location":[-84.411875,39.272659]}],"duration":10.7,"driving_side":"right"},{"intersections":[{"out":2,"in":0,"entry":[false,true,true],"bearings":[45,225,300],"location":[-84.412124,39.272437]}],"driving_side":"right","geometry":"wkunFvvebOK\\","mode":"driving","maneuver":{"bearing_after":299,"bearing_before":219,"location":[-84.412124,39.272437],"modifier":"right","type":"turn","instruction":"Turn right"},"weight":34,"duration":8.7,"name":"","distance":14.9},{"intersections":[{"out":0,"in":1,"entry":[true,false,true],"bearings":[30,120,300],"location":[-84.412274,39.272503]}],"driving_side":"right","geometry":"clunFtwebOEAGEUU","mode":"driving","maneuver":{"bearing_after":28,"bearing_before":299,"location":[-84.412274,39.272503],"modifier":"right","type":"turn","instruction":"Turn right"},"weight":42.7,"duration":10.6,"name":"","distance":23.7},{"intersections":[{"in":0,"entry":[true],"bearings":[220],"location":[-84.412115,39.272675]}],"driving_side":"right","geometry":"gmunFvvebO","mode":"driving","maneuver":{"bearing_after":0,"bearing_before":40,"location":[-84.412115,39.272675],"modifier":"left","type":"arrive","instruction":"You have arrived at your destination, on the left"},"weight":0,"duration":0,"name":"","distance":0}],"distance":545.6}],"weight_name":"routability","weight":143.6,"duration":73.2,"distance":545.6}],"waypoints":[{"name":"Hageman Street","location":[-84.411389,39.27665]},{"name":"testpass","location":[-84.412115,39.272675]}],"code":"Ok","uuid":"cjax1m38b0dz85op9878nbugo"} |
1 change: 1 addition & 0 deletions
1
MapboxDirectionsTests/Fixtures/Responses/noDestinationName.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"routes":[{"geometry":"afvnFdrebO@o@xT~@hAx@bAfAK\\c@]","legs":[{"summary":"Reading Road, Reading Road","weight":143.6,"duration":73.2,"steps":[{"intersections":[{"out":0,"entry":[true],"bearings":[95],"location":[-84.411389,39.27665]}],"driving_side":"right","geometry":"afvnFdrebO@o@","mode":"driving","maneuver":{"bearing_after":95,"bearing_before":0,"location":[-84.411389,39.27665],"type":"depart","instruction":"Head east on Hageman Street"},"weight":11.8,"duration":6.8,"name":"Hageman Street","distance":20.8},{"intersections":[{"out":1,"in":2,"entry":[true,true,false],"bearings":[0,180,270],"location":[-84.411148,39.276635]},{"out":2,"in":0,"entry":[false,false,true],"bearings":[0,30,180],"location":[-84.411372,39.274088]},{"out":1,"in":0,"entry":[false,true,true],"bearings":[0,180,270],"location":[-84.411386,39.273937]},{"out":2,"in":0,"entry":[false,true,true],"bearings":[0,30,180],"location":[-84.411401,39.273772]}],"driving_side":"right","geometry":"_fvnFtpebO`DJP@ZBvFTt@B\\B`@@fAFr@D","mode":"driving","maneuver":{"bearing_after":182,"bearing_before":94,"location":[-84.411148,39.276635],"modifier":"right","type":"turn","instruction":"Turn right onto Reading Road"},"weight":41.49999999999999,"pronunciation":"ˈrɛdɪŋ ˈɹoʊd","duration":36.4,"name":"Reading Road","distance":388.5},{"distance":97.7,"name":"Reading Road (US 42)","pronunciation":"ˈrɛdɪŋ ˈɹoʊd","ref":"US 42","maneuver":{"bearing_after":209,"bearing_before":184,"location":[-84.411469,39.273151],"modifier":"slight right","type":"continue","instruction":"Make a slight right to stay on Reading Road (US 42)"},"weight":13.6,"mode":"driving","geometry":"epunFtrebOXPLJHFJHJHVVFHb@d@","intersections":[{"out":2,"in":0,"entry":[false,true,true],"bearings":[0,180,210],"location":[-84.411469,39.273151]},{"out":2,"in":0,"entry":[false,false,true],"bearings":[30,75,210],"location":[-84.411756,39.27278]},{"out":2,"in":0,"entry":[false,false,true],"bearings":[30,75,225],"location":[-84.411875,39.272659]}],"duration":10.7,"driving_side":"right"},{"intersections":[{"out":2,"in":0,"entry":[false,true,true],"bearings":[45,225,300],"location":[-84.412124,39.272437]}],"driving_side":"right","geometry":"wkunFvvebOK\\","mode":"driving","maneuver":{"bearing_after":299,"bearing_before":219,"location":[-84.412124,39.272437],"modifier":"right","type":"turn","instruction":"Turn right"},"weight":34,"duration":8.7,"name":"","distance":14.9},{"intersections":[{"out":0,"in":1,"entry":[true,false,true],"bearings":[30,120,300],"location":[-84.412274,39.272503]}],"driving_side":"right","geometry":"clunFtwebOEAGEUU","mode":"driving","maneuver":{"bearing_after":28,"bearing_before":299,"location":[-84.412274,39.272503],"modifier":"right","type":"turn","instruction":"Turn right"},"weight":42.7,"duration":10.6,"name":"","distance":23.7},{"intersections":[{"in":0,"entry":[true],"bearings":[220],"location":[-84.412115,39.272675]}],"driving_side":"right","geometry":"gmunFvvebO","mode":"driving","maneuver":{"bearing_after":0,"bearing_before":40,"location":[-84.412115,39.272675],"modifier":"left","type":"arrive","instruction":"You have arrived at your destination, on the left"},"weight":0,"duration":0,"name":"","distance":0}],"distance":545.6}],"weight_name":"routability","weight":143.6,"duration":73.2,"distance":545.6}],"waypoints":[{"name":"Hageman Street","location":[-84.411389,39.27665]},{"name":"","location":[-84.412115,39.272675]}],"code":"Ok","uuid":"cjax1m38b0dz85op9878nbugo"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters