Open Map via intent

2 votes · 3 comments

Show point on google map via an intent.

raw ·
copy
· download
String uri = "geo:"+ latitude + "," + longitude; startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri))); // You can also choose to place a point like so: String uri = "geo:"+ latitude + "," + longitude + "?q=my+street+address"; startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri))); */ * The Possible Query params options are the following: * * Show map at location: geo:latitude,longitude * Show zoomed map at location: geo:latitude,longitude?z=zoom * Show map at locaiton with point: geo:0,0?q=my+street+address * Show map of businesses in area: geo:0,0?q=business+near+city * *
Add a comment

3 Comments

Thanks for the snippet :)

I think you forgot a ? in the uri Sting Correct one would be : String uri = "geo:"+ latitude + "," + longitude + "?q=my+street+address";

Reply · Sept. 8, 2009, 10:31 a.m.

Thanks Alx, I added it into the snippet.

Reply · Sept. 8, 2009, 5:38 p.m.

Thanks for the info...

Is it possible to make the Map show a marker at the given Lat/Lng ???

Reply · Oct. 3, 2009, 1:05 a.m.