How can I get directions for multiple waypoints with different transit methods using the Google Directions Service?

StackOverflow https://stackoverflow.com/questions/16926928

Question

So I understand how to use the Google Directions service to add waypoints and to change the transit mode but is it possible to do both with the same API call?

I'm trying to get directions that will involve walking, then biking, and then some more walking but I'm not sure how to do it using one API call. I know I can split it up into a few but it will then force me to process Google's response vs using the setDirections method.

These are the docs I'm going from: https://developers.google.com/maps/documentation/javascript/directions

Was it helpful?

Solution

but is it possible to do both with the same API call?

Not at present.

it will then force me to process Google's response vs using the setDirections method.

Why do you say that? Unless you want to do something special, you should be able to use the DirectionsRenderer to display the results from multiple calls to the DirectionsService either by combining them or using different DirectionRenderer objects for the different pieces.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top