Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

geo: Intent with label (Android)

Is there a working way (i heard that as of update 7.0 there were some changes) to display a marker with a position given by latitude/longitude with a label?

geo:?q=latitude, longitude (Label) does not work...

like image 775
joz Avatar asked Nov 09 '25 03:11

joz


1 Answers

Show point on google map via an intent:

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 location with point: geo:0,0?q=my+street+address

  • Show map of businesses in area: geo:0,0?q=business+near+city

like image 197
wSakly Avatar answered Nov 10 '25 22:11

wSakly



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!