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);
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);
No comments:
Post a Comment