diff --git a/MapboxDirections/MBDirectionsOptions.swift b/MapboxDirections/MBDirectionsOptions.swift
index ec560b80d..d16dfb295 100644
--- a/MapboxDirections/MBDirectionsOptions.swift
+++ b/MapboxDirections/MBDirectionsOptions.swift
@@ -444,6 +444,11 @@ open class DirectionsOptions: NSObject, NSSecureCoding, NSCopying {
params.append(URLQueryItem(name: "annotations", value: attributesStrings))
}
+ if !waypoints.compactMap({ $0.name }).isEmpty {
+ let names = waypoints.map { $0.name ?? "" }.joined(separator: ";")
+ params.append(URLQueryItem(name: "waypoint_names", value: names))
+ }
+
return params
}
}
diff --git a/MapboxDirectionsTests/Fixtures/instructions.json b/MapboxDirectionsTests/Fixtures/instructions.json
index 30aeb4947..1d859a3d5 100644
--- a/MapboxDirectionsTests/Fixtures/instructions.json
+++ b/MapboxDirectionsTests/Fixtures/instructions.json
@@ -1 +1 @@
-{"routes":[{"geometry":"}creFf{ijVEOGWEUCSCSAUAUG_BKmCASPIPIRIPGPGPERERCRERCRARCTCRAPARAJ?F?H@F@HDFBl@b@HDHBH@J?L@F?hDc@xDc@xDe@xDe@zDe@fDa@RCRCjBU\\EBATCC[YuEKuA[}EKeBAQEa@E}@AM[wEMmB[yEi@gIi@iIMkB[{Ei@iIi@gIg@_IASxDe@xDe@vAQVCREVIRIHETMDCJGDCxAu@RMROLILKLMJMLOLOLQJSLQJUN[La@L]H_@H_@Fa@D_@D_@Bc@@c@DaD@_@@_@@a@Ba@Bc@j@cGFq@Dm@Bo@Bm@Bm@Bm@@oABqANaR@a@?c@@a@@a@@_@Bc@B]Ba@Dc@De@XaDb@oCHg@Fg@Fk@Bc@Be@Bi@Bk@Fi@Fi@Hg@La@J]JYL]HQHOHQHMLSLQPSPQTOVMNGNE\\GJAtBOj@GnAUhGWd@C^?f@@d@@f@Dd@Fb@Ff@J`@Ld@P`@Pb@R`@T~Az@\\P^P^L^J^H^D^D^@`@@`@C`@Cb@Gb@Ib@O^O`@S^U`@Y^_@\\]Zc@Zc@Xc@p@eAV_@Xa@V[V[XUXWZSZQ`@S`@M^Kb@Ib@Gf@Ed@Cd@CbLg@r@Ct@Ap@ApB\\ZFZHf@LnAXtBh@lBb@RFPPLVHTR|@FRJRNLLFN@N?NENKLMbAyANONOJKRKPKRIRERCP?VDXFpFxA^LJ@J?J?bB[XEVATBRFnCt@^LPJTLn@`@XPxAbAP[f@eA`@{@JUHOf@eAz@kB\\s@NRZZd@b@h@`@f@ZVJIh@","legs":[{"summary":"Baker Street, Oak Street","weight":1390.8,"duration":997.4,"steps":[{"intersections":[{"out":0,"entry":[true],"bearings":[65],"location":[-122.444202,37.78127]},{"out":0,"in":2,"entry":[true,true,false],"bearings":[75,165,255],"location":[-122.443888,37.781367]},{"out":0,"in":2,"entry":[true,true,false],"bearings":[90,165,270],"location":[-122.442993,37.781471]}],"driving_side":"right","geometry":"}creFf{ijVEOGWEUCSCSAUAUG_BKmCAS","mode":"driving","maneuver":{"bearing_after":65,"bearing_before":0,"location":[-122.444202,37.78127],"modifier":"right","type":"depart","instruction":"Head northeast on Terra Vista Avenue"},"weight":34.8,"duration":29.5,"name":"Terra Vista Avenue","distance":181.2,"voiceInstructions":[{"distanceAlongGeometry":181.2,"announcement":"Head northeast on Terra Vista Avenue, then turn right onto Baker Street","ssmlAnnouncement":"Head northeast on Terra Vista Avenue, then turn right onto Baker Street"},{"distanceAlongGeometry":92.1,"announcement":"Turn right onto Baker Street","ssmlAnnouncement":"Turn right onto Baker Street"}],"bannerInstructions":[{"distanceAlongGeometry":181.2,"primary":{"type":"turn","modifier":"right","components":[{"text":"Baker Street","type":"text","abbr":"Baker St","abbr_priority":0}],"text":"Baker Street"},"secondary":null}]},{"intersections":[{"out":1,"in":2,"entry":[true,true,false],"bearings":[90,165,270],"location":[-122.44218,37.781539]},{"out":1,"in":0,"entry":[false,true,true],"bearings":[0,195,255],"location":[-122.441741,37.77989]},{"out":2,"in":0,"entry":[false,true,true,true],"bearings":[0,75,180,255],"location":[-122.442054,37.779272]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[75,165,255,345],"location":[-122.441884,37.778308]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[75,165,255,345],"location":[-122.441697,37.777378]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[75,165,255,345],"location":[-122.441507,37.776445]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[75,165,255,345],"location":[-122.441318,37.775515]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[75,165,255,345],"location":[-122.441127,37.774582]},{"out":1,"in":3,"entry":[false,true,true,false],"bearings":[75,165,255,345],"location":[-122.440935,37.773642]}],"driving_side":"right","geometry":"sereFrnijVPIPIRIPGPGPERERCRERCRARCTCRAPARAJ?F?H@F@HDFBl@b@HDHBH@J?L@F?hDc@xDc@xDe@xDe@zDe@fDa@RCRCjBU\\EBATC","mode":"driving","maneuver":{"bearing_after":157,"bearing_before":82,"location":[-122.44218,37.781539],"modifier":"right","type":"turn","instruction":"Turn right onto Baker Street"},"weight":329.8,"duration":229.7,"name":"Baker Street","distance":1001.4,"voiceInstructions":[{"distanceAlongGeometry":1001.4,"announcement":"Continue on Baker Street for a half mile","ssmlAnnouncement":"Continue on Baker Street for a half mile"},{"distanceAlongGeometry":305.2,"announcement":"In a quarter mile, turn left onto Oak Street","ssmlAnnouncement":"In a quarter mile, turn left onto Oak Street"},{"distanceAlongGeometry":65.4,"announcement":"Turn left onto Oak Street","ssmlAnnouncement":"Turn left onto Oak Street"}],"bannerInstructions":[{"distanceAlongGeometry":1001.4,"primary":{"type":"turn","modifier":"left","degrees":135,"components":[{"text":"Oak Street","type":"text","abbr":"Oak St","abbr_priority":0}],"text":"Oak Street"},"secondary":null}]},{"intersections":[{"out":0,"in":3,"entry":[true,true,false,false],"bearings":[75,165,255,345],"location":[-122.440751,37.772724]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.439109,37.772926]},{"out":0,"in":2,"entry":[true,true,false,false],"bearings":[75,165,255,345],"location":[-122.437487,37.773132]},{"out":0,"in":2,"entry":[true,false,false,true],"bearings":[75,165,255,345],"location":[-122.437395,37.773144]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.435772,37.77335]},{"out":0,"in":2,"entry":[true,true,false,false],"bearings":[75,165,255,345],"location":[-122.434127,37.773559]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.432486,37.773768]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.430839,37.773978]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.429195,37.774187]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.427551,37.774396]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.42591,37.774605]},{"out":0,"in":2,"entry":[true,true,false,false],"bearings":[75,165,255,345],"location":[-122.424308,37.774808]}],"driving_side":"right","geometry":"onpeFteijVC[YuEKuA[}EKeBAQEa@E}@AM[wEMmB[yEi@gIi@iIMkB[{Ei@iIi@gIg@_IAS","mode":"driving","maneuver":{"bearing_after":80,"bearing_before":170,"location":[-122.440751,37.772724],"modifier":"left","type":"turn","instruction":"Turn left onto Oak Street"},"weight":371.6,"duration":225.79999999999998,"name":"Oak Street","distance":1472.8,"voiceInstructions":[{"distanceAlongGeometry":1472.8,"announcement":"Continue on Oak Street for 1 mile","ssmlAnnouncement":"Continue on Oak Street for 1 mile"},{"distanceAlongGeometry":456.6,"announcement":"In a quarter mile, turn right onto Octavia Boulevard","ssmlAnnouncement":"In a quarter mile, turn right onto Octavia Boulevard"},{"distanceAlongGeometry":97.8,"announcement":"Turn right onto Octavia Boulevard","ssmlAnnouncement":"Turn right onto Octavia Boulevard"}],"bannerInstructions":[{"distanceAlongGeometry":1472.8,"primary":{"type":"turn","modifier":"right","components":[{"text":"Octavia Boulevard","type":"text","abbr":"Octavia Blvd","abbr_priority":0}],"text":"Octavia Boulevard"},"secondary":null}]},{"intersections":[{"out":1,"in":2,"entry":[true,true,false,false],"bearings":[75,165,255,345],"location":[-122.42421,37.774821]},{"out":1,"in":3,"entry":[false,true,true,false],"bearings":[75,165,255,345],"location":[-122.424022,37.773889]},{"out":1,"in":3,"entry":[false,true,true,false],"bearings":[75,165,255,345],"location":[-122.423832,37.772957]},{"out":1,"in":3,"entry":[false,true,false,false],"bearings":[45,150,225,330],"location":[-122.423485,37.771919]}],"driving_side":"right","geometry":"s{peFh~ejVxDe@xDe@vAQVCREVIRIHETMDCJGDC","mode":"driving","maneuver":{"bearing_after":170,"bearing_before":80,"location":[-122.42421,37.774821],"modifier":"right","type":"turn","instruction":"Turn right onto Octavia Boulevard"},"weight":142.5,"duration":94.2,"name":"Octavia Boulevard","distance":345.3,"voiceInstructions":[{"distanceAlongGeometry":345.3,"announcement":"In a quarter mile, take the ramp towards US 101: Central Freeway","ssmlAnnouncement":"In a quarter mile, take the ramp towards US 101: Central Freeway"},{"distanceAlongGeometry":55,"announcement":"Take the ramp towards US 101: Central Freeway","ssmlAnnouncement":"Take the ramp towards US 101: Central Freeway"}],"bannerInstructions":[{"distanceAlongGeometry":345.3,"primary":{"type":"turn","modifier":"straight","components":[{"text":"US 101","imageBaseURL":"https://s3.amazonaws.com/mapbox/shields/v3/us-101","type":"icon"},{"text":"/","type":"delimiter","delimiter":true},{"text":"I-80","imageBaseURL":"https://s3.amazonaws.com/mapbox/shields/v3/i-80","type":"icon"}],"text":"US 101 / I-80"},"secondary":{"type":"turn","modifier":"straight","components":[{"text":"Central Freeway","type":"text","abbr":"Central Fwy","abbr_priority":0}],"text":"Central Freeway"}}]},{"intersections":[{"classes":["motorway"],"out":1,"in":3,"entry":[false,true,false,false],"bearings":[45,150,225,330],"location":[-122.423406,37.771799]},{"classes":["motorway"],"out":0,"in":2,"entry":[true,false,false],"bearings":[90,255,270],"location":[-122.416662,37.769596]},{"classes":["motorway"],"out":1,"in":2,"entry":[true,true,false],"bearings":[102,108,282],"location":[-122.40981,37.769161]},{"classes":["motorway"],"out":0,"in":1,"entry":[true,false,false],"bearings":[174,353,358],"location":[-122.405473,37.767261]},{"classes":["motorway"],"out":1,"in":2,"entry":[false,true,false],"bearings":[0,180,345],"location":[-122.405244,37.766048]}],"driving_side":"right","geometry":"whpeFhyejVxAu@RMROLILKLMJMLOLOLQJSLQJUN[La@L]H_@H_@Fa@D_@D_@Bc@@c@DaD@_@@_@@a@Ba@Bc@j@cGFq@Dm@Bo@Bm@Bm@Bm@@oABqANaR@a@?c@@a@@a@@_@Bc@B]Ba@Dc@De@XaDb@oCHg@Fg@Fk@Bc@Be@Bi@Bk@Fi@Fi@Hg@La@J]JYL]HQHOHQHMLSLQPSPQTOVMNGNE\\GJAtBOj@GnAUhGWd@C^?f@@d@@f@Dd@Fb@Ff@J`@Ld@P`@Pb@R`@T~Az@\\P^P^L^J^H^D^D^@`@@`@C`@Cb@Gb@Ib@O^O`@S^U`@Y^_@\\]Zc@Zc@Xc@p@eAV_@Xa@V[V[XUXWZSZQ`@S`@M^Kb@Ib@Gf@Ed@Cd@CbLg@r@Ct@Ap@A","mode":"driving","destinations":"US 101, I-80: Central Freeway","maneuver":{"bearing_after":154,"bearing_before":151,"location":[-122.423406,37.771799],"modifier":"straight","type":"on ramp","instruction":"Take the ramp towards US 101: Central Freeway"},"weight":221.90000000000003,"duration":221.7,"name":"Central Freeway","distance":3509.8,"voiceInstructions":[{"distanceAlongGeometry":3509.8,"announcement":"In 2 miles, take exit 432 towards Cesar Chavez Street","ssmlAnnouncement":"In 2 miles, take exit 432 towards Cesar Chavez Street"},{"distanceAlongGeometry":804,"announcement":"In a half mile, take exit 432 towards Cesar Chavez Street","ssmlAnnouncement":"In a half mile, take exit 432 towards Cesar Chavez Street"},{"distanceAlongGeometry":402,"announcement":"Take exit 432 towards Cesar Chavez Street, then keep left towards Bayshore Boulevard","ssmlAnnouncement":"Take exit 432 towards Cesar Chavez Street, then keep left towards Bayshore Boulevard"}],"bannerInstructions":[{"distanceAlongGeometry":3509.8,"primary":{"type":"off ramp","modifier":"right","components":[{"text":"Exit 432:","type":"text"},{"text":"Cesar Chavez Street","type":"text","abbr":"Cesar Chavez St","abbr_priority":0}],"text":"Exit 432: Cesar Chavez Street"},"secondary":null}]},{"distance":120.7,"name":"","maneuver":{"bearing_after":191,"bearing_before":178,"location":[-122.402999,37.752554],"modifier":"slight right","type":"off ramp","instruction":"Take exit 432 towards Cesar Chavez Street"},"destinations":"Cesar Chavez Street","exits":"432","intersections":[{"classes":["motorway"],"out":2,"in":0,"entry":[false,true,true],"bearings":[0,180,195],"location":[-122.402999,37.752554]}],"duration":5.3,"driving_side":"right","weight":5.4,"mode":"driving","geometry":"mpleFvyajVpB\\ZFZHf@L","voiceInstructions":[{"distanceAlongGeometry":402,"announcement":"Keep left towards Bayshore Boulevard, then keep right towards Bayshore Boulevard","ssmlAnnouncement":"Keep left towards Bayshore Boulevard, then keep right towards Bayshore Boulevard"}],"bannerInstructions":[{"distanceAlongGeometry":120.7,"primary":{"type":"fork","modifier":"left","components":[{"text":"Exit 432:","type":"text"},{"text":"Bayshore Boulevard","type":"text","abbr":"Bayshore Blvd","abbr_priority":0}],"text":"Exit 432: Bayshore Boulevard"},"secondary":{"type":"fork","modifier":"left","components":[{"text":"Cesar Chavez Street","type":"text","abbr":"Cesar Chavez St","abbr_priority":0},{"text":"East","type":"text","abbr":"E","abbr_priority":1}],"text":"Cesar Chavez Street East"}}]},{"distance":189.2,"name":"","maneuver":{"bearing_after":194,"bearing_before":195,"location":[-122.40331,37.751497],"modifier":"slight left","type":"fork","instruction":"Keep left towards Bayshore Boulevard"},"destinations":"Bayshore Boulevard, Cesar Chavez Street East","exits":"432","intersections":[{"classes":["motorway"],"out":1,"in":0,"entry":[false,true,true],"bearings":[16,195,199],"location":[-122.40331,37.751497]}],"duration":11.2,"driving_side":"right","weight":11.4,"mode":"driving","geometry":"{ileFt{ajVnAXtBh@lBb@RF","voiceInstructions":[{"distanceAlongGeometry":402,"announcement":"Keep right towards Bayshore Boulevard, then continue onto Bayshore Boulevard","ssmlAnnouncement":"Keep right towards Bayshore Boulevard, then continue onto Bayshore Boulevard"}],"bannerInstructions":[{"distanceAlongGeometry":189.2,"primary":{"type":"fork","modifier":"right","components":[{"text":"Bayshore Boulevard","type":"text","abbr":"Bayshore Blvd","abbr_priority":0}],"text":"Bayshore Boulevard"},"secondary":null}]},{"intersections":[{"classes":["motorway"],"out":2,"in":0,"entry":[false,true,true],"bearings":[15,210,225],"location":[-122.403872,37.749855]},{"out":0,"in":2,"entry":[true,false,false],"bearings":[151,313,321],"location":[-122.404051,37.748414]}],"driving_side":"right","geometry":"s_leFd_bjVPPLVHTR|@FRJRNLLFN@N?NENKLMbAyANONOJKRKPK","mode":"driving","destinations":"Bayshore Boulevard","maneuver":{"bearing_after":219,"bearing_before":194,"location":[-122.403872,37.749855],"modifier":"slight right","type":"fork","instruction":"Keep right towards Bayshore Boulevard"},"weight":24.099999999999998,"duration":24.099999999999998,"name":"","distance":262.9,"voiceInstructions":[{"distanceAlongGeometry":402,"announcement":"Continue onto Bayshore Boulevard","ssmlAnnouncement":"Continue onto Bayshore Boulevard"}],"bannerInstructions":[{"distanceAlongGeometry":262.9,"primary":{"type":"turn","modifier":"straight","components":[{"text":"Bayshore Boulevard","type":"text","abbr":"Bayshore Blvd","abbr_priority":0}],"text":"Bayshore Boulevard"},"secondary":null}]},{"intersections":[{"out":0,"in":2,"entry":[true,false,false],"bearings":[159,327,331],"location":[-122.403871,37.74816]},{"out":2,"in":0,"entry":[false,true,true],"bearings":[15,180,195],"location":[-122.404294,37.746312]},{"out":1,"in":2,"entry":[false,true,false],"bearings":[0,195,345],"location":[-122.404187,37.745215]},{"out":1,"in":0,"entry":[false,true,true],"bearings":[15,195,285],"location":[-122.404522,37.744293]},{"out":1,"in":0,"entry":[false,true,true],"bearings":[30,210,300],"location":[-122.404891,37.743687]}],"driving_side":"right","geometry":"_ukeFd_bjVRIRERCP?VDXFpFxA^LJ@J?J?bB[XEVATBRFnCt@^LPJTLn@`@XPxAbA","mode":"driving","maneuver":{"bearing_after":158,"bearing_before":150,"location":[-122.403871,37.74816],"modifier":"straight","type":"new name","instruction":"Continue onto Bayshore Boulevard"},"weight":99.4,"duration":58.99999999999999,"name":"Bayshore Boulevard","distance":594.8,"voiceInstructions":[{"distanceAlongGeometry":594.8,"announcement":"In a quarter mile, turn left onto Oakdale Avenue","ssmlAnnouncement":"In a quarter mile, turn left onto Oakdale Avenue"},{"distanceAlongGeometry":151.2,"announcement":"Turn left onto Oakdale Avenue","ssmlAnnouncement":"Turn left onto Oakdale Avenue"}],"bannerInstructions":[{"distanceAlongGeometry":594.8,"primary":{"type":"turn","modifier":"left","components":[{"text":"Oakdale Avenue","type":"text","abbr":"Oakdale Ave","abbr_priority":0}],"text":"Oakdale Avenue"},"secondary":null}]},{"intersections":[{"out":1,"in":0,"entry":[false,true,true,true],"bearings":[30,120,210,315],"location":[-122.405321,37.743105]},{"out":1,"in":3,"entry":[true,true,false,false],"bearings":[30,120,210,300],"location":[-122.405177,37.743021]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[30,120,210,300],"location":[-122.404828,37.742817]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[30,120,210,300],"location":[-122.404339,37.74254]},{"out":1,"in":2,"entry":[true,true,false],"bearings":[0,120,300],"location":[-122.403451,37.742036]}],"driving_side":"right","geometry":"mujeFfhbjVP[f@eA`@{@JUHOf@eAz@kB\\s@","mode":"driving","maneuver":{"bearing_after":125,"bearing_before":209,"location":[-122.405321,37.743105],"modifier":"left","type":"turn","instruction":"Turn left onto Oakdale Avenue"},"weight":86.4,"duration":52.800000000000004,"name":"Oakdale Avenue","distance":231.6,"voiceInstructions":[{"distanceAlongGeometry":231.6,"announcement":"In 800 feet, turn right onto Barneveld Avenue","ssmlAnnouncement":"In 800 feet, turn right onto Barneveld Avenue"},{"distanceAlongGeometry":65.8,"announcement":"Turn right onto Barneveld Avenue, then turn right","ssmlAnnouncement":"Turn right onto Barneveld Avenue, then turn right"}],"bannerInstructions":[{"distanceAlongGeometry":231.6,"primary":{"type":"turn","modifier":"right","components":[{"text":"Barneveld Avenue","type":"text","abbr":"Barneveld Ave","abbr_priority":0}],"text":"Barneveld Avenue"},"secondary":null}]},{"intersections":[{"out":1,"in":2,"entry":[true,true,false],"bearings":[120,225,300],"location":[-122.403186,37.741886]},{"out":2,"in":0,"entry":[false,true,true],"bearings":[30,120,210],"location":[-122.403611,37.741476]},{"out":2,"in":0,"entry":[false,true,true],"bearings":[30,120,195],"location":[-122.40392,37.741066]}],"driving_side":"right","geometry":"ymjeF|zajVNRZZd@b@h@`@f@ZVJ","mode":"driving","maneuver":{"bearing_after":227,"bearing_before":125,"location":[-122.403186,37.741886],"modifier":"right","type":"turn","instruction":"Turn right onto Barneveld Avenue"},"weight":46,"duration":35.4,"name":"Barneveld Avenue","distance":126.9,"voiceInstructions":[{"distanceAlongGeometry":53.8,"announcement":"Turn right, then you will arrive at your destination","ssmlAnnouncement":"Turn right, then you will arrive at your destination"}],"bannerInstructions":[{"distanceAlongGeometry":126.9,"primary":{"type":"turn","modifier":"right","components":[{"text":"Turn right","type":"text"}],"text":"Turn right"},"secondary":null}]},{"intersections":[{"out":2,"in":0,"entry":[false,true,true],"bearings":[15,195,285],"location":[-122.403983,37.740945]}],"driving_side":"right","geometry":"}gjeFz_bjVIh@","mode":"driving","maneuver":{"bearing_after":288,"bearing_before":201,"location":[-122.403983,37.740945],"modifier":"right","type":"turn","instruction":"Turn right"},"weight":17.5,"duration":8.7,"name":"","distance":19.4,"voiceInstructions":[{"distanceAlongGeometry":6.7,"announcement":"You have arrived at your destination, straight ahead","ssmlAnnouncement":"You have arrived at your destination, straight ahead"}],"bannerInstructions":[{"distanceAlongGeometry":19.4,"primary":{"type":"arrive","modifier":"straight","components":[{"text":"You will arrive","type":"text"}],"text":"You will arrive"},"secondary":null},{"distanceAlongGeometry":15,"primary":{"type":"arrive","modifier":"straight","components":[{"text":"You have arrived","type":"text"}],"text":"You have arrived"},"secondary":null}]},{"intersections":[{"in":0,"entry":[true],"bearings":[109],"location":[-122.404192,37.741001]}],"driving_side":"right","geometry":"ghjeFdabjV","mode":"driving","maneuver":{"bearing_after":0,"bearing_before":289,"location":[-122.404192,37.741001],"modifier":"straight","type":"arrive","instruction":"You have arrived at your destination, straight ahead"},"weight":0,"duration":0,"name":"","distance":0,"voiceInstructions":[],"bannerInstructions":[]}],"distance":8056.1}],"weight_name":"routability","weight":1390.8,"duration":997.4,"distance":8056.1,"voiceLocale":"en-US"}],"waypoints":[{"name":"Terra Vista Avenue","location":[-122.444202,37.78127]},{"name":"","location":[-122.404192,37.741001]}],"code":"Ok","uuid":"cje68ha21000775o7je87k5em"}
+{"routes":[{"geometry":"}creFf{ijVEOGWEUCSCSAUAUG_BKmCASPIPIRIPGPGPERERCRERCRARCTCRAPARAJ?F?H@F@HDFBl@b@HDHBH@J?L@F?hDc@xDc@xDe@xDe@zDe@fDa@RCRCjBU\\EBATCNChDa@i@gIg@cIAQGy@Ce@]eFi@gIi@gIi@iIi@gIO{BYmEg@gIG_AE_@[_FASxDe@vAQVCREVIRIHETMDCJGDCxAu@RMROLILKLMJMLOLOLQJSLQJUN[La@L]H_@H_@Fa@D_@D_@Bc@@c@DaD@_@@_@@a@Ba@Bc@j@cGFq@Dm@Bo@Bm@Bm@Bm@@oABqANaR@a@?c@@a@@a@@_@Bc@B]Ba@Dc@De@XaDb@oCHg@Fg@Fk@Bc@Be@Bi@Bk@Fi@Fi@Hg@La@J]JYL]HQHOHQHMLSLQPSPQTOVMNGNE\\GJAtBOj@GnAUhGWd@C^?f@@d@@f@Dd@Fb@Ff@J`@Ld@P`@Pb@R`@T~Az@\\P^P^L^J^H^D^D^@`@@`@C`@Cb@Gb@Ib@O^O`@S^U`@Y^_@\\]Zc@Zc@Xc@p@eAV_@Xa@V[V[XUXWZSZQ`@S`@M^Kb@Ib@Gf@Ed@Cd@CbLg@r@Ct@Ap@ApB\\ZFZHf@LnAXtBh@lBb@RFPPLVHTR|@FRJRNLLFN@N?NENKLMbAyANONOJKRKPKRIRERCP?VDXFpFxA^LJ@J?J?bB[XEVATBRFnCt@^LPJTLn@`@XPl@`@j@`@P[f@eA`@{@JUHOf@eAz@kB\\s@NRZZd@b@h@`@f@ZVJIh@","legs":[{"summary":"Baker Street, Page Street","weight":1429.6,"duration":1157.6,"steps":[{"intersections":[{"out":0,"entry":[true],"bearings":[65],"location":[-122.444202,37.78127]},{"out":0,"in":2,"entry":[true,true,false],"bearings":[75,165,255],"location":[-122.443888,37.781367]},{"out":0,"in":2,"entry":[true,true,false],"bearings":[90,165,270],"location":[-122.442993,37.781471]}],"driving_side":"right","geometry":"}creFf{ijVEOGWEUCSCSAUAUG_BKmCAS","mode":"driving","maneuver":{"bearing_after":65,"bearing_before":0,"location":[-122.444202,37.78127],"type":"depart","instruction":"Head northeast on Terra Vista Avenue"},"weight":45.5,"duration":40,"name":"Terra Vista Avenue","distance":181.2,"voiceInstructions":[{"distanceAlongGeometry":181.2,"announcement":"Head northeast on Terra Vista Avenue, then turn right onto Baker Street","ssmlAnnouncement":"Head northeast on Terra Vista Avenue, then turn right onto Baker Street"},{"distanceAlongGeometry":67.9,"announcement":"Turn right onto Baker Street","ssmlAnnouncement":"Turn right onto Baker Street"}],"bannerInstructions":[{"distanceAlongGeometry":181.2,"primary":{"text":"Baker Street","components":[{"text":"Baker Street","type":"text","abbr":"Baker St","abbr_priority":0}],"type":"turn","modifier":"right"},"secondary":null}]},{"intersections":[{"out":1,"in":2,"entry":[true,true,false],"bearings":[90,165,270],"location":[-122.44218,37.781539]},{"out":1,"in":0,"entry":[false,true,true],"bearings":[0,195,255],"location":[-122.441741,37.77989]},{"out":2,"in":0,"entry":[false,true,true,true],"bearings":[0,75,180,255],"location":[-122.442054,37.779272]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[75,165,255,345],"location":[-122.441884,37.778308]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[75,165,255,345],"location":[-122.441697,37.777378]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[75,165,255,345],"location":[-122.441507,37.776445]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[75,165,255,345],"location":[-122.441318,37.775515]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[75,165,255,345],"location":[-122.441127,37.774582]},{"out":1,"in":3,"entry":[false,true,true,false],"bearings":[75,165,255,345],"location":[-122.440935,37.773642]},{"out":1,"in":3,"entry":[true,true,false,false],"bearings":[75,165,255,345],"location":[-122.440751,37.772724]}],"driving_side":"right","geometry":"sereFrnijVPIPIRIPGPGPERERCRERCRARCTCRAPARAJ?F?H@F@HDFBl@b@HDHBH@J?L@F?hDc@xDc@xDe@xDe@zDe@fDa@RCRCjBU\\EBATCNChDa@","mode":"driving","maneuver":{"bearing_after":157,"bearing_before":82,"location":[-122.44218,37.781539],"modifier":"right","type":"turn","instruction":"Turn right onto Baker Street"},"weight":386.70000000000005,"duration":305.79999999999995,"name":"Baker Street","distance":1107.1,"voiceInstructions":[{"distanceAlongGeometry":1107.1,"announcement":"Continue on Baker Street for a half mile","ssmlAnnouncement":"Continue on Baker Street for a half mile"},{"distanceAlongGeometry":253.4,"announcement":"In 900 feet, turn left onto Page Street","ssmlAnnouncement":"In 900 feet, turn left onto Page Street"},{"distanceAlongGeometry":54.3,"announcement":"Turn left onto Page Street","ssmlAnnouncement":"Turn left onto Page Street"}],"bannerInstructions":[{"distanceAlongGeometry":1107.1,"primary":{"text":"Page Street","components":[{"text":"Page Street","type":"text","abbr":"Page St","abbr_priority":0}],"type":"turn","modifier":"left"},"secondary":null}]},{"intersections":[{"out":0,"in":3,"entry":[true,true,true,false],"bearings":[75,165,255,345],"location":[-122.440561,37.771786]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.438921,37.771995]},{"out":0,"in":2,"entry":[true,true,false,false],"bearings":[75,165,255,345],"location":[-122.437299,37.772202]},{"out":0,"in":2,"entry":[true,false,false,true],"bearings":[75,165,255,345],"location":[-122.437207,37.772213]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.435584,37.77242]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.43394,37.772629]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.432298,37.772838]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.430651,37.773048]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.429007,37.773258]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.427364,37.773467]},{"out":0,"in":2,"entry":[true,true,false,true],"bearings":[75,165,255,345],"location":[-122.425723,37.773673]},{"out":0,"in":2,"entry":[true,true,false,false],"bearings":[75,165,255,345],"location":[-122.424118,37.773877]}],"driving_side":"right","geometry":"uhpeFndijVi@gIg@cIAQGy@Ce@]eFi@gIi@gIi@iIi@gIO{BYmEg@gIG_AE_@[_FAS","mode":"driving","maneuver":{"bearing_after":80,"bearing_before":170,"location":[-122.440561,37.771786],"modifier":"left","type":"turn","instruction":"Turn left onto Page Street"},"weight":403.5,"duration":354.1,"name":"Page Street","distance":1472.8,"voiceInstructions":[{"distanceAlongGeometry":1472.8,"announcement":"Continue on Page Street for 1 mile","ssmlAnnouncement":"Continue on Page Street for 1 mile"},{"distanceAlongGeometry":291.1,"announcement":"In 1000 feet, turn right onto Octavia Boulevard","ssmlAnnouncement":"In 1000 feet, turn right onto Octavia Boulevard"},{"distanceAlongGeometry":62.4,"announcement":"Turn right onto Octavia Boulevard","ssmlAnnouncement":"Turn right onto Octavia Boulevard"}],"bannerInstructions":[{"distanceAlongGeometry":1472.8,"primary":{"text":"Octavia Boulevard","components":[{"text":"Octavia Boulevard","type":"text","abbr":"Octavia Blvd","abbr_priority":0}],"type":"turn","modifier":"right"},"secondary":null}]},{"intersections":[{"out":1,"in":2,"entry":[true,true,false,false],"bearings":[75,165,255,345],"location":[-122.424022,37.773889]},{"out":1,"in":3,"entry":[false,true,true,false],"bearings":[75,165,255,345],"location":[-122.423832,37.772957]}],"driving_side":"right","geometry":"yupeFb}ejVxDe@vAQVCREVIRIHETM","mode":"driving","maneuver":{"bearing_after":170,"bearing_before":80,"location":[-122.424022,37.773889],"modifier":"right","type":"turn","instruction":"Turn right onto Octavia Boulevard"},"weight":91.3,"duration":67.1,"name":"Octavia Boulevard","distance":225.3,"voiceInstructions":[{"distanceAlongGeometry":225.3,"announcement":"In 800 feet, continue towards US 101: Central Freeway","ssmlAnnouncement":"In 800 feet, continue towards US 101: Central Freeway"},{"distanceAlongGeometry":50.4,"announcement":"Continue towards US 101: Central Freeway","ssmlAnnouncement":"Continue towards US 101: Central Freeway"}],"bannerInstructions":[{"distanceAlongGeometry":225.3,"primary":{"text":"US 101 / I-80","components":[{"text":"US 101","type":"icon","imageBaseURL":"https://s3.amazonaws.com/mapbox/shields/v3/us-101"},{"text":"/","type":"delimiter","delimiter":true},{"text":"I-80","type":"icon","imageBaseURL":"https://s3.amazonaws.com/mapbox/shields/v3/i-80"}],"type":"turn","modifier":"straight"},"secondary":{"text":"Central Freeway","components":[{"text":"Central Freeway","type":"text","abbr":"Central Fwy","abbr_priority":0}],"type":"turn","modifier":"straight"}}]},{"intersections":[{"out":1,"in":3,"entry":[false,true,false,false],"bearings":[45,150,225,330],"location":[-122.423485,37.771919]},{"classes":["motorway"],"out":1,"in":3,"entry":[false,true,false,false],"bearings":[45,150,225,330],"location":[-122.423406,37.771799]},{"classes":["motorway"],"out":0,"in":2,"entry":[true,false,false],"bearings":[90,255,285],"location":[-122.416662,37.769596]},{"classes":["motorway"],"out":1,"in":2,"entry":[true,true,false],"bearings":[102,108,282],"location":[-122.40981,37.769161]},{"classes":["motorway"],"out":0,"in":1,"entry":[true,false,false],"bearings":[174,353,358],"location":[-122.405473,37.767261]},{"classes":["motorway"],"out":1,"in":2,"entry":[false,true,false],"bearings":[0,180,345],"location":[-122.405244,37.766048]}],"driving_side":"right","geometry":"oipeFxyejVDCJGDCxAu@RMROLILKLMJMLOLOLQJSLQJUN[La@L]H_@H_@Fa@D_@D_@Bc@@c@DaD@_@@_@@a@Ba@Bc@j@cGFq@Dm@Bo@Bm@Bm@Bm@@oABqANaR@a@?c@@a@@a@@_@Bc@B]Ba@Dc@De@XaDb@oCHg@Fg@Fk@Bc@Be@Bi@Bk@Fi@Fi@Hg@La@J]JYL]HQHOHQHMLSLQPSPQTOVMNGNE\\GJAtBOj@GnAUhGWd@C^?f@@d@@f@Dd@Fb@Ff@J`@Ld@P`@Pb@R`@T~Az@\\P^P^L^J^H^D^D^@`@@`@C`@Cb@Gb@Ib@O^O`@S^U`@Y^_@\\]Zc@Zc@Xc@p@eAV_@Xa@V[V[XUXWZSZQ`@S`@M^Kb@Ib@Gf@Ed@Cd@CbLg@r@Ct@Ap@A","mode":"driving","destinations":"US 101, I-80: Central Freeway","maneuver":{"bearing_after":151,"bearing_before":153,"location":[-122.423485,37.771919],"modifier":"straight","type":"new name","instruction":"Continue towards US 101: Central Freeway"},"weight":222.2,"duration":203.9,"name":"Central Freeway","distance":3524.8,"voiceInstructions":[{"distanceAlongGeometry":3524.8,"announcement":"In 2 miles, take exit 432 towards Cesar Chavez Street","ssmlAnnouncement":"In 2 miles, take exit 432 towards Cesar Chavez Street"},{"distanceAlongGeometry":804,"announcement":"In a half mile, take exit 432 towards Cesar Chavez Street","ssmlAnnouncement":"In a half mile, take exit 432 towards Cesar Chavez Street"},{"distanceAlongGeometry":402,"announcement":"Take exit 432 towards Cesar Chavez Street, then keep left towards Bayshore Boulevard","ssmlAnnouncement":"Take exit 432 towards Cesar Chavez Street, then keep left towards Bayshore Boulevard"}],"bannerInstructions":[{"distanceAlongGeometry":3524.8,"primary":{"text":"Exit 432 Cesar Chavez Street","components":[{"text":"Exit","type":"exit"},{"text":"432","type":"exit-number"},{"text":"Cesar Chavez Street","type":"text","abbr":"Cesar Chavez St","abbr_priority":0}],"type":"off ramp","modifier":"right"},"secondary":null},{"distanceAlongGeometry":432.1726336439431,"primary":{"text":"Exit 432 Cesar Chavez Street","components":[{"text":"Exit","type":"exit"},{"text":"432","type":"exit-number"},{"text":"Cesar Chavez Street","type":"text","abbr":"Cesar Chavez St","abbr_priority":0}],"type":"off ramp","modifier":"right"},"secondary":null,"sub":{"text":"Exit 432 Bayshore Boulevard","components":[{"text":"Exit","type":"exit"},{"text":"432","type":"exit-number"},{"text":"Bayshore Boulevard","type":"text","abbr":"Bayshore Blvd","abbr_priority":0}],"type":"fork","modifier":"left"}}]},{"distance":120.7,"name":"","maneuver":{"bearing_after":191,"bearing_before":177,"location":[-122.402999,37.752554],"modifier":"slight right","type":"off ramp","instruction":"Take exit 432 towards Cesar Chavez Street"},"destinations":"Cesar Chavez Street","exits":"432","intersections":[{"classes":["motorway"],"out":2,"in":0,"entry":[false,true,true],"bearings":[0,180,195],"location":[-122.402999,37.752554]}],"duration":6.1,"driving_side":"right","weight":6.2,"mode":"driving","geometry":"mpleFvyajVpB\\ZFZHf@L","voiceInstructions":[{"distanceAlongGeometry":120.7,"announcement":"Keep left towards Bayshore Boulevard, then keep right towards Bayshore Boulevard","ssmlAnnouncement":"Keep left towards Bayshore Boulevard, then keep right towards Bayshore Boulevard"}],"bannerInstructions":[{"distanceAlongGeometry":120.7,"primary":{"text":"Exit 432 Bayshore Boulevard","components":[{"text":"Exit","type":"exit"},{"text":"432","type":"exit-number"},{"text":"Bayshore Boulevard","type":"text","abbr":"Bayshore Blvd","abbr_priority":0}],"type":"fork","modifier":"left"},"secondary":{"text":"Cesar Chavez Street East","components":[{"text":"Cesar Chavez Street","type":"text","abbr":"Cesar Chavez St","abbr_priority":0},{"text":"East","type":"text","abbr":"E","abbr_priority":1}],"type":"fork","modifier":"left"},"sub":{"text":"Bayshore Boulevard","components":[{"text":"Bayshore Boulevard","type":"text","abbr":"Bayshore Blvd","abbr_priority":0}],"type":"fork","modifier":"right"}}]},{"distance":189.2,"name":"","maneuver":{"bearing_after":194,"bearing_before":195,"location":[-122.40331,37.751497],"modifier":"slight left","type":"fork","instruction":"Keep left towards Bayshore Boulevard"},"destinations":"Bayshore Boulevard, Cesar Chavez Street East","exits":"432","intersections":[{"classes":["motorway"],"out":1,"in":0,"entry":[false,true,true],"bearings":[16,195,199],"location":[-122.40331,37.751497]}],"duration":11.3,"driving_side":"right","weight":11.5,"mode":"driving","geometry":"{ileFt{ajVnAXtBh@lBb@RF","voiceInstructions":[{"distanceAlongGeometry":189.2,"announcement":"Keep right towards Bayshore Boulevard, then continue onto Bayshore Boulevard","ssmlAnnouncement":"Keep right towards Bayshore Boulevard, then continue onto Bayshore Boulevard"}],"bannerInstructions":[{"distanceAlongGeometry":189.2,"primary":{"text":"Bayshore Boulevard","components":[{"text":"Bayshore Boulevard","type":"text","abbr":"Bayshore Blvd","abbr_priority":0}],"type":"fork","modifier":"right"},"secondary":null,"sub":{"text":"Bayshore Boulevard","components":[{"text":"Bayshore Boulevard","type":"text","abbr":"Bayshore Blvd","abbr_priority":0}],"type":"turn","modifier":"straight"}}]},{"intersections":[{"classes":["motorway"],"out":2,"in":0,"entry":[false,true,true],"bearings":[15,210,225],"location":[-122.403872,37.749855]},{"out":0,"in":2,"entry":[true,false,false],"bearings":[151,313,321],"location":[-122.404051,37.748414]}],"driving_side":"right","geometry":"s_leFd_bjVPPLVHTR|@FRJRNLLFN@N?NENKLMbAyANONOJKRKPK","mode":"driving","destinations":"Bayshore Boulevard","maneuver":{"bearing_after":219,"bearing_before":194,"location":[-122.403872,37.749855],"modifier":"slight right","type":"fork","instruction":"Keep right towards Bayshore Boulevard"},"weight":17.1,"duration":17.1,"name":"","distance":262.9,"voiceInstructions":[{"distanceAlongGeometry":262.9,"announcement":"Continue onto Bayshore Boulevard","ssmlAnnouncement":"Continue onto Bayshore Boulevard"}],"bannerInstructions":[{"distanceAlongGeometry":262.9,"primary":{"text":"Bayshore Boulevard","components":[{"text":"Bayshore Boulevard","type":"text","abbr":"Bayshore Blvd","abbr_priority":0}],"type":"turn","modifier":"straight"},"secondary":null}]},{"intersections":[{"out":0,"in":2,"entry":[true,false,false],"bearings":[159,327,331],"location":[-122.403871,37.74816]},{"out":2,"in":0,"entry":[false,true,true],"bearings":[15,180,195],"location":[-122.404294,37.746312]},{"out":1,"in":2,"entry":[false,true,false],"bearings":[6,196,355],"location":[-122.404187,37.745215]},{"out":1,"in":0,"entry":[false,true,true],"bearings":[15,195,285],"location":[-122.404522,37.744293]},{"out":1,"in":0,"entry":[false,true,true],"bearings":[30,210,300],"location":[-122.404891,37.743687]}],"driving_side":"right","geometry":"_ukeFd_bjVRIRERCP?VDXFpFxA^LJ@J?J?bB[XEVATBRFnCt@^LPJTLn@`@XPl@`@j@`@","mode":"driving","maneuver":{"bearing_after":158,"bearing_before":150,"location":[-122.403871,37.74816],"modifier":"straight","type":"new name","instruction":"Continue onto Bayshore Boulevard"},"weight":99,"duration":58.6,"name":"Bayshore Boulevard","distance":594.8,"voiceInstructions":[{"distanceAlongGeometry":594.8,"announcement":"In a quarter mile, turn left onto Oakdale Avenue","ssmlAnnouncement":"In a quarter mile, turn left onto Oakdale Avenue"},{"distanceAlongGeometry":152.3,"announcement":"Turn left onto Oakdale Avenue","ssmlAnnouncement":"Turn left onto Oakdale Avenue"}],"bannerInstructions":[{"distanceAlongGeometry":594.8,"primary":{"text":"Oakdale Avenue","components":[{"text":"Oakdale Avenue","type":"text","abbr":"Oakdale Ave","abbr_priority":0}],"type":"turn","modifier":"left"},"secondary":null}]},{"intersections":[{"out":1,"in":0,"entry":[false,true,true,true],"bearings":[30,120,210,315],"location":[-122.405321,37.743105]},{"out":1,"in":3,"entry":[true,true,false,false],"bearings":[30,120,210,300],"location":[-122.405177,37.743021]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[30,120,210,300],"location":[-122.404828,37.742817]},{"out":1,"in":3,"entry":[true,true,true,false],"bearings":[30,120,210,300],"location":[-122.404339,37.74254]},{"out":1,"in":2,"entry":[true,true,false],"bearings":[0,120,300],"location":[-122.403451,37.742036]}],"driving_side":"right","geometry":"mujeFfhbjVP[f@eA`@{@JUHOf@eAz@kB\\s@","mode":"driving","maneuver":{"bearing_after":125,"bearing_before":209,"location":[-122.405321,37.743105],"modifier":"left","type":"turn","instruction":"Turn left onto Oakdale Avenue"},"weight":90.1,"duration":56.5,"name":"Oakdale Avenue","distance":231.6,"voiceInstructions":[{"distanceAlongGeometry":231.6,"announcement":"In 800 feet, turn right onto Barneveld Avenue","ssmlAnnouncement":"In 800 feet, turn right onto Barneveld Avenue"},{"distanceAlongGeometry":61.5,"announcement":"Turn right onto Barneveld Avenue, then turn right","ssmlAnnouncement":"Turn right onto Barneveld Avenue, then turn right"}],"bannerInstructions":[{"distanceAlongGeometry":231.6,"primary":{"text":"Barneveld Avenue","components":[{"text":"Barneveld Avenue","type":"text","abbr":"Barneveld Ave","abbr_priority":0}],"type":"turn","modifier":"right"},"secondary":null},{"distanceAlongGeometry":61.48672566371682,"primary":{"text":"Barneveld Avenue","components":[{"text":"Barneveld Avenue","type":"text","abbr":"Barneveld Ave","abbr_priority":0}],"type":"turn","modifier":"right"},"secondary":null,"sub":{"text":"Turn right","components":[{"text":"Turn right","type":"text"}],"type":"turn","modifier":"right"}}]},{"intersections":[{"out":1,"in":2,"entry":[true,true,false],"bearings":[120,225,300],"location":[-122.403186,37.741886]},{"out":2,"in":0,"entry":[false,true,true],"bearings":[30,120,210],"location":[-122.403611,37.741476]},{"out":2,"in":0,"entry":[false,true,true],"bearings":[30,120,195],"location":[-122.40392,37.741066]}],"driving_side":"right","geometry":"ymjeF|zajVNRZZd@b@h@`@f@ZVJ","mode":"driving","maneuver":{"bearing_after":227,"bearing_before":125,"location":[-122.403186,37.741886],"modifier":"right","type":"turn","instruction":"Turn right onto Barneveld Avenue"},"weight":39,"duration":28.4,"name":"Barneveld Avenue","distance":126.9,"voiceInstructions":[{"distanceAlongGeometry":67,"announcement":"Turn right, then you will arrive at your destination","ssmlAnnouncement":"Turn right, then you will arrive at your destination"}],"bannerInstructions":[{"distanceAlongGeometry":126.9,"primary":{"text":"Turn right","components":[{"text":"Turn right","type":"text"}],"type":"turn","modifier":"right"},"secondary":null}]},{"intersections":[{"out":2,"in":0,"entry":[false,true,true],"bearings":[15,195,285],"location":[-122.403983,37.740945]}],"driving_side":"right","geometry":"}gjeFz_bjVIh@","mode":"driving","maneuver":{"bearing_after":288,"bearing_before":201,"location":[-122.403983,37.740945],"modifier":"right","type":"turn","instruction":"Turn right"},"weight":17.5,"duration":8.7,"name":"","distance":19.4,"voiceInstructions":[{"distanceAlongGeometry":6.7,"announcement":"You have arrived at the gym","ssmlAnnouncement":"You have arrived at the gym"}],"bannerInstructions":[{"distanceAlongGeometry":19.4,"primary":{"text":"You will arrive","components":[{"text":"You will arrive","type":"text"}],"type":"arrive","modifier":"straight"},"secondary":{"text":"the gym","components":[{"text":"the gym","type":"text"}],"type":"arrive","modifier":"straight"}},{"distanceAlongGeometry":15,"primary":{"text":"You have arrived","components":[{"text":"You have arrived","type":"text"}],"type":"arrive","modifier":"straight"},"secondary":{"text":"the gym","components":[{"text":"the gym","type":"text"}],"type":"arrive","modifier":"straight"}}]},{"intersections":[{"in":0,"entry":[true],"bearings":[109],"location":[-122.404192,37.741001]}],"driving_side":"right","geometry":"ghjeFdabjV","mode":"driving","maneuver":{"bearing_after":0,"bearing_before":289,"location":[-122.404192,37.741001],"type":"arrive","instruction":"You have arrived at the gym"},"weight":0,"duration":0,"name":"","distance":0,"voiceInstructions":[],"bannerInstructions":[]}],"distance":8056.7}],"weight_name":"routability","weight":1429.6,"duration":1157.6,"distance":8056.7,"voiceLocale":"en-US"}],"waypoints":[{"name":"Terra Vista Avenue","location":[-122.444202,37.78127]},{"name":"","location":[-122.404192,37.741001]}],"code":"Ok","uuid":"cjgy4xps418g17mo7l2pdm734"}
diff --git a/MapboxDirectionsTests/IntructionsTests.swift b/MapboxDirectionsTests/IntructionsTests.swift
index b3b228de8..3a6adb34c 100644
--- a/MapboxDirectionsTests/IntructionsTests.swift
+++ b/MapboxDirectionsTests/IntructionsTests.swift
@@ -20,7 +20,8 @@ class SpokenInstructionsTests: XCTestCase {
"access_token": BogusToken,
"voice_instructions": "true",
"voice_units": "imperial",
- "banner_instructions": "true"
+ "banner_instructions": "true",
+ "waypoint_names": "the hotel;the gym"
]
stub(condition: isHost("api.mapbox.com")
@@ -29,10 +30,10 @@ class SpokenInstructionsTests: XCTestCase {
return OHHTTPStubsResponse(fileAtPath: path!, statusCode: 200, headers: ["Content-Type": "application/json"])
}
- let options = RouteOptions(coordinates: [
- CLLocationCoordinate2D(latitude: 37.780602, longitude: -122.431373),
- CLLocationCoordinate2D(latitude: 37.758859, longitude: -122.404058),
- ], profileIdentifier: .automobileAvoidingTraffic)
+ let startWaypoint = Waypoint(location: CLLocation(latitude: 37.780602, longitude: -122.431373), heading: nil, name: "the hotel")
+ let endWaypoint = Waypoint(location: CLLocation(latitude: 37.758859, longitude: -122.404058), heading: nil, name: "the gym")
+
+ let options = RouteOptions(waypoints: [startWaypoint, endWaypoint], profileIdentifier: .automobileAvoidingTraffic)
options.shapeFormat = .polyline
options.includesSteps = true
options.includesAlternativeRoutes = false
@@ -58,7 +59,7 @@ class SpokenInstructionsTests: XCTestCase {
}
XCTAssertNotNil(route)
- XCTAssertEqual(route!.routeIdentifier, "cje68ha21000775o7je87k5em")
+ XCTAssertEqual(route!.routeIdentifier, "cjgy4xps418g17mo7l2pdm734")
let leg = route!.legs.first!
let step = leg.steps[1]
@@ -67,31 +68,37 @@ class SpokenInstructionsTests: XCTestCase {
let spokenInstructions = step.instructionsSpokenAlongStep!
- XCTAssertEqual(spokenInstructions[0].distanceAlongStep, 1001.4)
+ XCTAssertEqual(spokenInstructions[0].distanceAlongStep, 1107.1)
XCTAssertEqual(spokenInstructions[0].ssmlText, "Continue on Baker Street for a half mile")
XCTAssertEqual(spokenInstructions[0].text, "Continue on Baker Street for a half mile")
- XCTAssertEqual(spokenInstructions[1].ssmlText, "In a quarter mile, turn left onto Oak Street")
- XCTAssertEqual(spokenInstructions[1].text, "In a quarter mile, turn left onto Oak Street")
- XCTAssertEqual(spokenInstructions[2].ssmlText, "Turn left onto Oak Street")
- XCTAssertEqual(spokenInstructions[2].text, "Turn left onto Oak Street")
+ XCTAssertEqual(spokenInstructions[1].ssmlText, "In 900 feet, turn left onto Page Street")
+ XCTAssertEqual(spokenInstructions[1].text, "In 900 feet, turn left onto Page Street")
+ XCTAssertEqual(spokenInstructions[2].ssmlText, "Turn left onto Page Street")
+ XCTAssertEqual(spokenInstructions[2].text, "Turn left onto Page Street")
+
+ let arrivalStep = leg.steps[leg.steps.endIndex - 2]
+ XCTAssertEqual(arrivalStep.instructionsSpokenAlongStep!.count, 1)
+
+ let arrivalSpokenInstructions = arrivalStep.instructionsSpokenAlongStep!
+ XCTAssertEqual(arrivalSpokenInstructions[0].text, "You have arrived at the gym")
+ XCTAssertEqual(arrivalSpokenInstructions[0].ssmlText, "You have arrived at the gym")
let visualInstructions = step.instructionsDisplayedAlongStep
XCTAssertNotNil(visualInstructions)
- XCTAssertEqual(visualInstructions?.first?.primaryInstruction.text, "Oak Street")
- XCTAssertEqual(visualInstructions?.first?.primaryInstruction.textComponents.first!.text, "Oak Street")
- XCTAssertEqual(visualInstructions?.first?.distanceAlongStep, 1001.4)
- XCTAssertEqual(visualInstructions?.first?.primaryInstruction.finalHeading, 135)
+ XCTAssertEqual(visualInstructions?.first?.primaryInstruction.text, "Page Street")
+ XCTAssertEqual(visualInstructions?.first?.primaryInstruction.textComponents.first!.text, "Page Street")
+ XCTAssertEqual(visualInstructions?.first?.distanceAlongStep, 1107.1)
+ XCTAssertEqual(visualInstructions?.first?.primaryInstruction.finalHeading, 180.0)
XCTAssertEqual(visualInstructions?.first?.primaryInstruction.maneuverType, .turn)
XCTAssertEqual(visualInstructions?.first?.primaryInstruction.maneuverDirection, .left)
XCTAssertEqual(visualInstructions?.first?.primaryInstruction.textComponents.first?.type, .text)
- XCTAssertEqual(visualInstructions?.first?.primaryInstruction.textComponents.first?.abbreviation, "Oak St")
+ XCTAssertEqual(visualInstructions?.first?.primaryInstruction.textComponents.first?.abbreviation, "Page St")
XCTAssertEqual(visualInstructions?.first?.primaryInstruction.textComponents.first?.abbreviationPriority, 0)
XCTAssertEqual(visualInstructions?.first?.drivingSide, .right)
XCTAssertNil(visualInstructions?.first?.secondaryInstruction)
- XCTAssertEqual(leg.steps[3].instructionsDisplayedAlongStep?.first?.primaryInstruction.textComponents[0].type, .image)
- XCTAssertEqual(leg.steps[3].instructionsDisplayedAlongStep?.first?.primaryInstruction.textComponents[1].type, .delimiter)
- XCTAssertEqual(leg.steps[3].instructionsDisplayedAlongStep?.first?.primaryInstruction.textComponents[2].type, .image)
+ let arrivalVisualInstructions = arrivalStep.instructionsDisplayedAlongStep!
+ XCTAssertEqual(arrivalVisualInstructions.first?.secondaryInstruction?.text, "the gym")
}
}