Reputation: 1341
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
Reputation: 227
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
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