You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Response for calculate(_: completionHandler:) sometimes fails to decode, when RouteOptions is NavigationRouteOptions with profileIdentifier set to .cycling. If directions require user to dismount bike, then mode field in one of the RouteStep parts of response is set to pushing bike:
This is the usual transport type when the `profileIdentifier` is `DirectionsProfileIdentifier.walking`. For cycling directions, this value indicates that the user is expected to dismount.
suggests that walking should be returned as mode instead of pushing bike
Apparently the documentation is incorrect. OSRM returns pushing bike as the mode. The plan at some point may have been for the Directions API to transform it to walking, but that hasn’t happened. When we rewrote RouteStep in #382, we probably saw this table in the documentation and thought pushing bike had gotten replaced by walking in Directions API v5 and the pushing bike support was only present for v4 compatibility.
We can fix the issue by mapping pushing bike to walking in the context of the cycling profile. There’s currently an effort underway to transition the cycling profile from OSRM to Valhalla, which lacks support for the bike-pushing mode, so it probably isn’t worth keeping an explicit bike-pushing mode around. Once the API cuts over to Valhalla, this mapping from pushing bike to walking would become dead code.
@1ec5 Thank you. Is there some estimate when the transition to Valhalla will be finished? IMO this is pretty serious bug right now, as it prevents SDK users from getting bicycle directions in many cases. Maybe it would be best for now to implement parsing pushing bike as walking in RouteStep? This should be pretty easy fix - we only need to implement decoding and coding by hand instead of relying on compiler-generated implementation. I can do it if this change is welcome
Version: 1.0.0-alpha.1
Response for
calculate(_: completionHandler:)
sometimes fails to decode, whenRouteOptions
isNavigationRouteOptions
withprofileIdentifier
set to.cycling
. If directions require user to dismount bike, thenmode
field in one of theRouteStep
parts of response is set topushing bike
:RouteStep
does not support this type of mode.mode
is represented byTransportType
enum which does not have case for that.Documentation comment:
mapbox-directions-swift/Sources/MapboxDirections/RouteStep.swift
Line 45 in cb704e6
walking
should be returned as mode instead ofpushing bike
Documentation for Directions API doesn't mention this type of mode: https://docs.mapbox.com/api/navigation/#route-step-object
The text was updated successfully, but these errors were encountered: