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

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

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

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top