Starting Google Maps App with provided location and marker

前端 未结 2 1162
无人及你
无人及你 2020-12-30 02:48

From my app I would like to start the Google Maps App with a provided location and a marker. The marker should indicate, that there is something on that given location.

相关标签:
2条回答
  • 2020-12-30 02:55

    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

    0 讨论(0)
  • 2020-12-30 03: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.

    0 讨论(0)
提交回复
热议问题