Amos
Amos

Reputation: 1341

Android - Google maps to show location name instead of longitude and latitude

I have this code to start a navigation activity

String uri = "geo:0,0?q=<lat>,<long>";
startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri)));

Google Maps starts and show the correct location on the map but at the bottom panel, instead of the location name to find a route to, I see the latitude and longitude I've sent.

The lat/long data makes it certain about the location I want but shows this info while sending it the location name might show it as I expect but it might get confused with several similar locations. How can I solve this?

Upvotes: 1

Views: 1642

Answers (2)

You can show a name in the marker in google maps using the following URI:

   String uri = "geo:0,0?q=34.99,-106.61(Treasure)";

As explained in android documentation

Upvotes: 2

Andy
Andy

Reputation: 2414

Not quite sure I fully understand what you're asking for, but it sounds like you want Reverse Geocoding. You can convert your Lat/Lng to a location with it. It generally gives a very detailed response, usually including the street address number, so that's one way to distinguish similar locations.

Upvotes: 0

Related Questions