Possible Duplicate:
J2ME/Android/BlackBerry - driving directions, route between two locations
I'm just writing an App for displaying the route between two coords (lat, long) in google maps view. Displaying an single coord (even with a marker) works fine, but how to draw route between two point with 2 markers?
I must admit that I'm quite new to Android and the maps-API...
You can create multiple routes in the backend and display them on your Google Maps. Visitors will be able to show/hide them easily on the frontend. Just enter a start and an end point to get directions. You can continue to add routes without losing the previous ones.
Once you've selected a location, tap Directions at the bottom of the screen. Next to the Your Location box, tap the three dots. Tap Route Options. Turn the sliders on for each option you want Google Maps to take into account when calculating your route.
this is working example link. check it out. it helps to create the route overlay on the map. here is the complete source code for that.
Your route will be a list of points so you have to create a route overlay class. And in the draw method of the overlay class you have to draw a Path between the points.
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