jd-alexander / Google-Directions-Android

This project allows you to calculate the route between two locations and displays it on a map.
https://play.google.com/store/apps/details?id=com.directions.sample
MIT License
979 stars 394 forks source link

Alternative Routes #34

Closed yusufiga closed 9 years ago

yusufiga commented 9 years ago

-Added alternative routes -Added distance value and duration value

jd-alexander commented 9 years ago

Okay. I havent been able to go through this as yet. Another contributor did something similar. What's the main difference with what's being done here??

yusufiga commented 9 years ago

Before this contribution Developers can use only one route because your library returns only the one route on onRoutingSuccess method but now onRoutingSuccess method returns route as an ArrayList. This is the main difference.

Google gives us more than one route(sometimes 3 or more) between two points with this contribution, developers are able to use alternative routes. Therefore if the developer draw the alternative routes on map which is came with ArrayList, users can pick which routes is better for them.

Also I just added the values for distance and duration into the route object. Therefore we can use this values for more detailed distance and duration informations.

Extra : With shortestRouteIndex parameter developers still able to know which route is the shortest route.

yusufiga commented 9 years ago

I also added the alternative routes on the sample.