-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION]: Serializing navigation routes #4675
Comments
@azarovalex, do you know Mapbox Navigation SDK 3+ supports route serialization? |
This is very disappointing. My application relies on saving Routes offline, which is achievable in Navigation SDK 2 because Route struct is Codable so I can easily store it. Now, in SDK v3 they abstracted it with NavigationRoutes which is not serializable. It breaks my whole app functionality. Time to check Apple's topographic maps in iOS 18. Before releasing new updates you should should account for backwards compatibility. |
Hi @lpeancovschi! |
Hi @Udumft! Thank you for your reply! The app I'm building will provide functionality for users to create a trail: by dropping pins on the map and then other users would be able to find an existing trail and view its details: preview route, elevation, etc. (similar to what AllTrails does).
|
Hey!
To summarize: to build a new route, user may do a 'usual' online request (like it is implemented now). When saving the route for other users, you could store it's waypoints, optionally add several 'silent' waypoints along the route, and store the required metadata (elevation, distance, etc.). When browsing saved routes, users will have to first download the required offline regions using the route's waypoints (it won't result in additional costs, comparing to current implementation, as tiles would be downloaded anyway), and re-build the route using provided waypoints with an offline router. Users may then continue and navigate that offline route object, or do a fresh online request if needed. |
Thanks, @Udumft! I will try loading the tiles first and then calculating the path in off-line. However I don't really like the fact that UX of the app has to be adjusted because of SDK limitations. |
Hi! |
Mapbox Navigation SDK version
3+
Steps to reproduce
In navigation map SDK 2+ it was possible to show navigation routes by providing Route array to it. It was useful because Route object is serializable and can be saved.
Navigation SDK 3+ changed this method to accept a NavigationRoutes struct instead, which is not Codable.
My question is: given I want to be able to store routes offline and also make sure I can store them in a future proof way, how can I serialize them? Also, NavigationRoutes doesn't seem to have public initializers.
Expected behavior
NavigationRoutes should be Codable or provide a simple API for constructing a route on a map.
Actual behavior
NavigationRoutes is not Codable.
Is this a one-time issue or a repeatable issue?
one-time
The text was updated successfully, but these errors were encountered: