1
votes

I'm trying to get directions for a user provided origin and destination, while showing directions to a middle location for ALL travel modes (driving, walking, bicycling, transit).

I have this coded using waypoints, but I just discovered that the Google Maps API doesn't support waypoints for public transit--as discussed in a previous question here.

I'm having difficulty finding any examples for how to go about piecing together multiple directions requests without using waypoints. Is there a way to add multiple directions to the directionsDisplay variable?

Example: Display directions from A -> B, then add directions from B -> C to the existing display.

1
There is an example stringing multiple directions requests together (of the same type) in this question: Google Maps API to get bus route, and another one in this question: JavaScript Google Maps polylines : issue in connecting all given GPS locationsgeocodezip
@geocodezip Those are a little off from my question. I just found this question though: Multiple travel modes to render one map using google maps API and it seems a little more closer to my question.blunatic

1 Answers

0
votes

Found my answer based on this question: Multiple travel modes to render one map using google maps API

Multiple directionsDisplays are needed, with multiple trip legs (requests) being sent to directionsService.route().