Showing posts with label route between two geo points. Show all posts
Showing posts with label route between two geo points. Show all posts

Friday, September 16, 2011

Route Map in Android

The following snippet shows the route between two Geo points in google map using default maps application.

Uri uri = Uri.parse("http://maps.google.com/maps?&saddr=slat,slon&daddr=dlat,dlon");

Here saddr -> source address
        daddr -> destination address
        slat    -> source latitude
        slon   -> source longitude
        dlat   -> destination latitude
        dlon  -> destination longitude

 Intent intent = new Intent(Intent.ACTION_VIEW, uri);
 startActivity(intent);