Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display a route between two geocoords in google maps? [duplicate]

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

like image 315
poeschlorn Avatar asked Apr 15 '10 09:04

poeschlorn


People also ask

Can you overlay multiple routes on Google Maps?

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.

How do I show alternate routes on maps?

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.


2 Answers

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.

like image 124
Praveen Avatar answered Oct 13 '22 02:10

Praveen


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.

like image 34
Robby Pond Avatar answered Oct 13 '22 02:10

Robby Pond