Specur Specur - 1 year ago 297
Android Question

How to show marker in Maps launched by geo uri Intent?

I have a application where I want to show different locations (one at the time, picked by user input) by launching Google Maps with their specific geo-coords.

I'm currently using this: (with real lat. and long. values of course)

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:<lat>,<long>?z=17"));

It's quite exactly what I want, except that it doesn't show any indicator or marker for the specified point. It only centers at it's location.

Is there some way to get the marker or something else included without using a MapView?

Answer Source

Try this:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:<lat>,<long>?q=<lat>,<long>(Label+Name)"));

You can omit (Label+Name) if you don't want a label, and it will choose one randomly based on the nearest street or other thing it thinks relevant.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download