I am using the following url to get driving directions from google maps.
http://maps.google.com/maps?f=d&hl=en&saddr=location1&daddr=location2&ie=UTF8&0&om=0&output=kml
I am getting only one route in my KML file. But when we searched same locations in web-browser it will show suggested routes.
In order to get all routes available as output, is there any other parameter to add in URL.
I found some answers as use google directions API for JavaScript with &alternatives=true Is it suitable for android ?? or any other solutions ??
Don't comment if URL have any mistakes, i used correct one in my application.
Thanks
The answer does not address the question directly, but here it is:
I'd suggest using The Google Directions API and JSON output as far as
1) this API is better documented,
2) the parsing of JSON is much easier and
3) JSON consumes less network traffic because it stores data more effectively than XML (KML).
To solve your problem with Google Directions API you will just need to add alternatives=true
request parameter.
However, look through this document. Perhaps, start=n
parameter is what you're looking for.
You can combine these 2 urls: URL1 URL2 to get your best result
But, this would make your program slow.:).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With