Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 646
Dan Goldin Avatar asked Oct 21 '22 08:10

Dan Goldin


1 Answers

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.

like image 75
geocodezip Avatar answered Oct 31 '22 16:10

geocodezip