Reputation: 11
How to create a route in google map for my android location. I had a straight line only but I want to do is an accurate line connecting may start and end locations. Thanks in advance!
Upvotes: 1
Views: 1703
Reputation: 5707
Use URL
"http://maps.googleapis.com/maps/api/directions/json?"
+ "origin=" + start.latitude + "," + start.longitude
+ "&destination=" + end.latitude + "," + end.longitude
+ "&sensor=false&units=metric&mode=driving";
phrase the lat n long value and Add poly line as per the Start and End Point.
For More Details http://blog-emildesign.rhcloud.com/?p=822
Upvotes: 1
Reputation: 73721
I created a library that will draw directions on a map between 2 points using google directions API.
its as simple as it gets
https://github.com/tyczj/MapNavigator
Upvotes: 1
Reputation: 6899
Use Google map direction parser. Tutorial is here.Hope this might help.
Upvotes: 0
Reputation: 3814
you need to use Google Directions API. You will have to generate an URL and parse the XML/JSON result. I do recommend to use my library that creates a set of objects which may help you to paint lines in the map. https://github.com/perezdidac/google-directions-api. Let me know if it helps you.
Upvotes: 0