Closed palicka closed 2 years ago
@mapbox/navnative could you please take a look at this route? NavNative reports invalid state, unless intersections are replaced with empty arrays. This happens to me with 68.0.0 version as well.
Hi @palicka
is it possible to add &overview=full
to your request? It should work in this case.
@palicka, the fix should be available in one of next releases. But meanwhile you can use workaround proposed by @SiarheiFedartsou
Android API: 29 Mapbox Navigation SDK version: 1.3.0
I need to set custom route generated from api.mapbox.com but navigation is not working (I've noticed similar issue #4248 but I'm not sure if it's the same problem)
request:
https://api.mapbox.com/directions/v5/mapbox/driving/-97.942153%2C35.687285%3B-97.955552%2C35.726065?alternatives=false&geometries=polyline6&steps=true&access_token=TOKEN&voice_instructions=true&banner_instructions=true
response:
{"routes":[{"weight_name":"auto","weight":343.03,"duration":349.665,"distance":5504.86,"legs":[{"admins":[{"iso_3166_1_alpha3":"USA","iso_3166_1":"US"}],"weight":343.03,"duration":349.665,"steps":[{"bannerInstructions":[{"sub":{"components":[{"active":false,"directions":["left"],"type":"lane","text":""},{"active":false,"directions":["straight"],"type":"lane","text":""},{"active_direction":"right","active":true,"directions":["straight","right"],"type":"lane","text":""}],"text":""},"primary":{"components":[{"type":"text","text":"Stroh Avenue"}],"type":"turn","modifier":"right","text":"Stroh Avenue"},"distanceAlongGeometry":1341.861}],"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Drive northwest on Oklahoma 3 West, Northwest Expressway.</prosody></amazon:effect></speak>","announcement":"Drive northwest on Oklahoma 3 West, Northwest Expressway.","distanceAlongGeometry":1341.861},{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">In 1 mile, Turn right onto Stroh Avenue.</prosody></amazon:effect></speak>","announcement":"In 1 mile, Turn right onto Stroh Avenue.","distanceAlongGeometry":1311.861},{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">In a half mile, Turn right onto Stroh Avenue.</prosody></amazon:effect></speak>","announcement":"In a half mile, Turn right onto Stroh Avenue.","distanceAlongGeometry":804.672},{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Turn right onto Stroh Avenue.</prosody></amazon:effect></speak>","announcement":"Turn right onto Stroh Avenue.","distanceAlongGeometry":150}],"intersections":[{"entry":[true],"bearings":[298],"duration":19.195,"mapbox_streets_v8":{"class":"trunk"},"is_urban":false,"admin_index":0,"out":0,"weight":17.276,"geometry_index":0,"location":[-97.942153,35.687285]},{"entry":[false,true],"in":0,"bearings":[118,298],"duration":2.894,"mapbox_streets_v8":{"class":"trunk"},"is_urban":false,"admin_index":0,"out":1,"weight":2.605,"geometry_index":1,"location":[-97.947456,35.689587]},{"lanes":[{"indications":["left"],"valid":false,"active":false},{"indications":["straight"],"valid_indication":"straight","valid":true,"active":true},{"indications":["straight"],"valid_indication":"straight","valid":true,"active":true}],"location":[-97.948255,35.689934],"geometry_index":2,"admin_index":0,"weight":20.734,"is_urban":false,"mapbox_streets_v8":{"class":"trunk"},"turn_duration":0.007,"turn_weight":0.5,"duration":22.489,"bearings":[118,298],"out":1,"in":0,"entry":[false,true]},{"bearings":[116,297],"entry":[false,true],"in":0,"mapbox_streets_v8":{"class":"trunk"},"is_urban":false,"admin_index":0,"out":1,"geometry_index":8,"location":[-97.954538,35.69251]}],"maneuver":{"type":"depart","instruction":"Drive northwest on OK 3 West/Northwest Expressway.","bearing_after":298,"bearing_before":0,"location":[-97.942153,35.687285]},"name":"Northwest Expressway","duration":47.367,"distance":1341.861,"driving_side":"right","weight":43.124,"mode":"driving","ref":"OK 3 West","geometry":"ivdacApg|xyD{nCljIuT|p@ekArnDuS|m@}Onh@}Mhf@sPzr@sMld@iSpo@"},{"bannerInstructions":[{"primary":{"components":[{"type":"text","text":"Choctaw Road"},{"type":"delimiter","text":"/"},{"type":"icon","text":"CR N2830"}],"type":"turn","modifier":"right","text":"Choctaw Road / CR N2830"},"distanceAlongGeometry":678}],"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Continue for a half mile.</prosody></amazon:effect></speak>","announcement":"Continue for a half mile.","distanceAlongGeometry":664.667},{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">In a quarter mile, Turn right onto Choctaw Road.</prosody></amazon:effect></speak>","announcement":"In a quarter mile, Turn right onto Choctaw Road.","distanceAlongGeometry":402.336},{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Turn right onto Choctaw Road, County Route N28 30.</prosody></amazon:effect></speak>","announcement":"Turn right onto Choctaw Road, County Route N28 30.","distanceAlongGeometry":84.444}],"intersections":[{"lanes":[{"indications":["left"],"valid":false,"active":false},{"indications":["straight"],"valid":false,"active":false},{"indications":["straight","right"],"valid_indication":"right","valid":true,"active":true}],"location":[-97.955315,35.692835],"geometry_index":9,"admin_index":0,"weight":50.12,"is_urban":false,"mapbox_streets_v8":{"class":"street"},"turn_duration":1.551,"turn_weight":8,"duration":48.351,"bearings":[21,117],"out":0,"in":1,"entry":[true,false]},{"bearings":[155,334],"entry":[false,true],"in":0,"turn_weight":0.5,"turn_duration":0.019,"mapbox_streets_v8":{"class":"street"},"is_urban":false,"admin_index":0,"out":1,"geometry_index":21,"location":[-97.958862,35.696682]}],"maneuver":{"type":"turn","instruction":"Turn right onto Stroh Avenue.","modifier":"right","bearing_after":21,"bearing_before":297,"location":[-97.955315,35.692835]},"name":"Stroh Avenue","duration":60.27,"distance":678,"driving_side":"right","weight":61.33,"mode":"driving","geometry":"eqoacAd~uyyDmD_BqB]qAZu@r@aArB_DfJ_Qbi@{LdXwQxV{g@zd@kf@rZgxArr@a{@vc@"},{"bannerInstructions":[{"primary":{"components":[{"type":"text","text":"248th Street Northeast"}],"type":"turn","modifier":"right","text":"248th Street Northeast"},"distanceAlongGeometry":3174.999}],"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Continue for 2 miles.</prosody></amazon:effect></speak>","announcement":"Continue for 2 miles.","distanceAlongGeometry":3161.666},{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">In a quarter mile, Turn right onto 248th Street Northeast.</prosody></amazon:effect></speak>","announcement":"In a quarter mile, Turn right onto 248th Street Northeast.","distanceAlongGeometry":402.336},{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Turn right onto 248th Street Northeast.</prosody></amazon:effect></speak>","announcement":"Turn right onto 248th Street Northeast.","distanceAlongGeometry":62.222}],"intersections":[{"entry":[true,false],"in":1,"bearings":[48,154],"duration":17.315,"turn_weight":8,"turn_duration":0.935,"mapbox_streets_v8":{"class":"street"},"is_urban":false,"admin_index":0,"out":0,"weight":22.742,"geometry_index":22,"location":[-97.95945,35.697643]},{"entry":[false,true],"in":0,"bearings":[180,360],"duration":92.321,"turn_weight":0.5,"turn_duration":0.007,"mapbox_streets_v8":{"class":"street"},"is_urban":false,"admin_index":0,"out":1,"weight":83.583,"geometry_index":28,"location":[-97.959097,35.698358]},{"bearings":[0,180],"entry":[true,false],"in":1,"turn_weight":7,"turn_duration":0.007,"mapbox_streets_v8":{"class":"street"},"is_urban":false,"admin_index":0,"out":0,"geometry_index":30,"location":[-97.959083,35.711262]}],"maneuver":{"type":"turn","instruction":"Turn right onto Choctaw Road/CR N2830.","modifier":"right","bearing_after":48,"bearing_before":334,"location":[-97.95945,35.697643]},"name":"Choctaw Road","duration":225.973,"distance":3174.999,"driving_side":"right","weight":218.021,"mode":"driving","ref":"CR N2830","geometry":"u}xacAr
~yyDsFqIgE{DwDeBmG_A_GOsG@qCf@}cTcAogDg@wsVyC"},{"bannerInstructions":[{"primary":{"components":[{"type":"text","text":"You will arrive at your destination"}],"type":"arrive","modifier":"straight","text":"You will arrive at your destination"},"distanceAlongGeometry":310},{"primary":{"components":[{"type":"text","text":"You have arrived at your destination"}],"type":"arrive","modifier":"straight","text":"You have arrived at your destination"},"distanceAlongGeometry":48.611}],"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">In a quarter mile, You will arrive at your destination.</prosody></amazon:effect></speak>","announcement":"In a quarter mile, You will arrive at your destination.","distanceAlongGeometry":298.333},{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">You have arrived at your destination.</prosody></amazon:effect></speak>","announcement":"You have arrived at your destination.","distanceAlongGeometry":48.611}],"intersections":[{"bearings":[90,180],"entry":[true,false],"in":1,"turn_weight":8,"turn_duration":2.105,"mapbox_streets_v8":{"class":"street"},"is_urban":false,"admin_index":0,"out":0,"geometry_index":32,"location":[-97.958986,35.726066]}],"maneuver":{"type":"turn","instruction":"Turn right onto 248th Street Northeast.","modifier":"right","bearing_after":90,"bearing_before":0,"location":[-97.958986,35.726066]},"name":"248th Street Northeast","duration":16.055,"distance":310,"driving_side":"right","weight":20.555,"mode":"driving","geometry":"cnpccArc}yyDQwgBR{lB"},{"bannerInstructions":[],"voiceInstructions":[],"intersections":[{"bearings":[270],"entry":[true],"in":0,"admin_index":0,"geometry_index":34,"location":[-97.955552,35.726065]}],"maneuver":{"type":"arrive","instruction":"You have arrived at your destination.","bearing_after":0,"bearing_before":90,"location":[-97.955552,35.726065]},"name":"248th Street Northeast","duration":0,"distance":0,"driving_side":"right","weight":0,"mode":"driving","geometry":"anpccA~lvyyD??"}],"distance":5504.86,"summary":"OK 3 West, Choctaw Road"}],"geometry":"ivdacApg|xyD{yIruXynBlmCu{D~rBac@cUkku@{E@suE","voiceLocale":"en-US"}],"waypoints":[{"distance":0,"name":"OK 3 West","location":[-97.942153,35.687285]},{"distance":0,"name":"248th Street Northeast","location":[-97.955552,35.726065]}],"code":"Ok","uuid":"VkZ5APIA9DomgwpSscljOOvbQqyQ54RdBUetbHnaF3hxEo-TiAacyQ=="}
After some investigation I found out the problem is in
intersections
fields. When I replaced all intersections arrays in the response above with empty arrays [], navigation is working.This is how it looks when it's not working (route progress state is ROUTE_INVALID)
I also have a question, are information from intersections array from the response necessary for the navigation itself ? Is it safe to replace it with empty arrays ? Thanks