Geo: intention with a place

I'm trying to make a button to launch Google maps on the device and open a specific location [not only lat / lon, although this is a backup].

I have a place id and want to run geo: intention to place. I can't seem to find the uri structure I need to do - any ideas?

+5
source share
1 answer

I know this question is old, but it is still an urgent issue that has not yet been implemented by Google. There is no direct URI for this, but I solved it with the q parameter. First I send the name of the place, and then the address. For me it works very well.

  Uri gmmIntentUri = Uri.parse("geo:0,0?q=" + place.getName() + ", " + place.getAddress()); Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri); mapIntent.setPackage("com.google.android.apps.maps"); startActivity(mapIntent); 

If you do not have an address and a name, you can find this through the Web Service Web Sites API .

+2
source

Source: https://habr.com/ru/post/1236933/


All Articles