Sahil Khanna
Sahil Khanna

Reputation: 4382

Suggested Routes - Google Directions API

I want to get a list of directions between two locations. Google Directions API says that the results are placed in routes array.

I tried directions using API and got only a single direction, but when searched in Google Maps with the search text as "Hall Bazar, Amritsar to Majitha Road, Amritsar", I got three route suggestions.

Please correct me if I misunderstood Google Directions API.

Upvotes: 1

Views: 1431

Answers (2)

Deepak Negi
Deepak Negi

Reputation: 1

var request = {
    origin: start,
    destination: end,
    travelMode: google.maps.TravelMode.DRIVING,
    provideRouteAlternatives:true
};

put  provideRouteAlternatives:true

Upvotes: -1

barryhunter
barryhunter

Reputation: 21091

Check the documentation, you need to ask for alternatives

&alternatives=true

Upvotes: 2

Related Questions