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 coordinates.
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")); startActivity(intent);
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?
Type the name of a location or address.Then tap Add new point. Drag the marker on the map to where you want to add a marker. Then tap Select this location.
The Google Maps pin is the inverted-drop-shaped icon that marks locations in Google Maps. The pin is protected under a U.S. design patent as "teardrop-shaped marker icon including a shadow". Google has used the pin in various graphics, games, and promotional materials.
Once you have markers on the map, you can retrieve the Lat/Long coordinates through the API and use this to set the map's center. You'll first just need to determine which marker you wish to center on - I'll leave that up to you. Hope this helps.
Try this:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:<lat>,<long>?q=<lat>,<long>(Label+Name)")); startActivity(intent);
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With