Calling google maps with custom route from activity.

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Calling google maps with custom route from activity.

Postby Ghost » Mon Aug 08, 2011 2:37 pm

Hi,
I'm wondering whether it is possible to call google maps from my activity and provide custom start and end point's so that google maps would calculate the route itself?

It would also be great if you could provide any links to articles or give code example, if it's possible, that is :roll:

Thank you,
Martin
Ghost
Developer
Developer
 
Posts: 26
Joined: Fri Feb 11, 2011 2:50 pm

Top

Re: Calling google maps with custom route from activity.

Postby Ghost » Thu Aug 11, 2011 6:16 am

Basically you would do something like this:
Code: Select all
                  Uri uri = Uri.parse(
                        "http://maps.google.com/maps?saddr="
                        + getLatitude() + ","
                        + getLongitude() + "&daddr="
                        + destLatitude ","
                        + destLongitude;
                  Intent intentMaps = new Intent(android.content.Intent.ACTION_VIEW, uri);
                  startActivity(intentMaps);
Ghost
Developer
Developer
 
Posts: 26
Joined: Fri Feb 11, 2011 2:50 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 4 guests