Starting Google Maps App with provided location and marker

北战南征 提交于 2019-11-30 06:21:12

Try starting Google Maps using the same intent, but with a URI of the format:

geo:34.067214,-118.349332?q=410+Hauser+Boulevard,+Los+Angeles,+CA

i.e. geo:0,0?q=street+address

The application should then actually show a point at that address. If you do not have the address, you may have to use a service to translate it to an address for this to work.

-

The other option is to embed a MapView in your application and add a marker within that. A tutorial for using MapViews / Markers with-in your application can be found at http://mobiforge.com/developing/story/using-google-maps-android.

Maybe you can try to put ur uri as below: Uri uri =Uri.parse("http://maps.google.com/maps?q=" +_lat +","+_lon);

At least the above code work for me. It help me add a pin point on top of the location i search for. furthermore, the pin point will have a small dialog box to press on, it provide me the function of searching the direction to that location. :D

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!