1

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.

Community
  • 1
  • 1
blunatic
  • 325
  • 2
  • 6
  • 16
  • There is an example stringing multiple directions requests together (of the same type) in this question: [Google Maps API to get bus route](http://stackoverflow.com/questions/15315347/google-maps-api-to-get-bus-route), and another one in this question: [JavaScript Google Maps polylines : issue in connecting all given GPS locations](http://stackoverflow.com/questions/27609872/javascript-google-maps-polylines-issue-in-connecting-all-given-gps-locations) – geocodezip Apr 13 '15 at 21:47
  • @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](http://stackoverflow.com/questions/22922856/multiple-travel-modes-to-render-one-map-using-google-maps-api) and it seems a little more closer to my question. – blunatic Apr 13 '15 at 21:52

1 Answers1

0

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().

Community
  • 1
  • 1
blunatic
  • 325
  • 2
  • 6
  • 16