2

I want to display some markers using the geo: intent to display a map at a specified location and zoom level. But I don't know how to add my markers here? Can somebody help me with this?

// Creates an Intent that will load a map of San Francisco
Uri gmmIntentUri = Uri.parse("geo:37.7749,-122.4194");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);

Thanks in advice for some help.

Cap
  • 57
  • 7

1 Answers1

0

try the following example:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("geo:37.7749,-122.4194?q=37.7749,-122.4194 (San Francisco)"));
// the following line should be used if you want use only Google maps
intent.setComponent(new ComponentName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"));
startActivity(intent);
mohammadReza Abiri
  • 1,759
  • 1
  • 9
  • 20
  • Thanks, this works well, but it only shows 1 Marker. What about showing 2 or 3 Markers? Do you have a solution for this? – Cap Nov 15 '19 at 08:59
  • No, its not solved, because your answer is good for 1 Marker, but I would like to have more than 1 Marker. – Cap Nov 18 '19 at 11:37