0

My app opens google map through ACTION.VIEW intent. When I give only latitude and longitude, the map displays the area without marker. To get the marker i used the following code,

Uri uri = Uri.parse("geo:"+Double.parseDouble(dealer_lat)+","+Double.parseDouble(dealer_long)+"?q="+Uri.encode(dealer_nameX+", "+provider_location.toLowerCase()+","+provider_street.toLowerCase()));
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.setPackage("com.google.android.apps.maps");
startActivity(intent);

But this code does search of the location through the address i provide. I need to add marker to the location given by latLng while also display the Marker label with certain text. What should i do ?

mrnobody
  • 409
  • 2
  • 8
  • 16
  • You can check out [this answer](http://stackoverflow.com/questions/7168522/starting-google-maps-app-with-provided-location-and-marker?rq=1) for the sake of completion. – Konstantinos Michael Feb 25 '16 at 10:12

1 Answers1

0
   String uri = "http://maps.google.com/maps?f=d&hl=en&saddr=" + geoPoint.getLatitude() + "," + geoPoint.getLongitude() + "&daddr=" +
                trip.getPickupLocation().getLatitude() + "," + trip.getPickupLocation().getLongitude();

        Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
        startActivity(Intent.createChooser(intent, "Select an application"));
Leonid Veremchuk
  • 1,952
  • 15
  • 27