Adeel Nazir
Adeel Nazir

Reputation: 9

How to Set Multiple Waypoints for Turn-by-Turn Navigation in React Native?

I'm working on a React Native project and want to implement turn-by-turn navigation with predefined routes. I need to set multiple waypoints for the route, but I'm facing an issue with the** Mapbox** Navigation SDK. It seems that I cannot set more than 25 waypoints, and the SDK automatically adjusts the route, ignoring additional waypoints.

Is there any way to work around this limitation in Mapbox? Alternatively, if I switch to using the Google Maps API for navigation, can I achieve the same functionality with multiple waypoints? If so, could you provide guidance on how to implement this using Google Maps API in React Native?

Thank you for your help!

Using Mapbox Navigation SDK: I attempted to set up turn-by-turn navigation using the Mapbox Navigation SDK in my React Native app. I defined an array of waypoints exceeding 25, but the SDK truncated the waypoints and set the route autonomously, which was not my intended behavior. Consulting Documentation: I reviewed the Mapbox documentation regarding the limitations on waypoints, but I couldn't find a solution that allowed for more than 25 waypoints to be set for navigation. Exploring Workarounds: I looked for possible workarounds or configurations in the SDK that might allow the use of more waypoints, but none were apparent. What I Was Expecting:

I expected to be able to pass an array of waypoints to the Mapbox Navigation SDK without limitations, allowing me to define a specific route with all my desired waypoints included. Alternatively, if using the Google Maps API, I hoped to achieve similar functionality where I could specify a route with multiple waypoints and receive turn-by-turn navigation as intended.

Upvotes: -1

Views: 46

Answers (1)

wia
wia

Reputation: 214

I ran into this problem too with Mapbox (max 25 waypoints).

I was implemented an algorithm which is responsible for pumping waypoints into navigation engine in periodic manner like a moving snake.

It works mostly, but really hard to track and maintain which waypoints are in the "completed" or in the "remaining" set of waypoints. Since my users can deviate from planned road.

Upvotes: 0

Related Questions