I partitioned gps data points into multiple routes using Google API. I need the routes to return in a specific order, but since the API is asynchronous, the order that the routes return in is random.
Ex: I have 23 waypoints to turn into a route but google can't fit that many waypoints in one route
Route1 contains waypoints (1, 2, 3, 4, 5, 6, 7, 8) in that order
Route2 contains waypoints (9, 10, 11, 12, 13, 14, 15, 16)
Route3 contains waypoints (17, 18, 19, 20, 21, 22, 23)
I made multiple DirectionsService.route() calls using these routes, I want to receive the responses as Route1, Route2, Route3. How can I achieve this?