Get coordinates on tapping map in android

前端 未结 6 1775
北海茫月
北海茫月 2020-12-01 12:49

I\'m trying to make something like this: I have a mapactivity and when the user taps the map it shows the coordinates of that location. I already overrided the onclick metho

6条回答
  •  旧时难觅i
    2020-12-01 13:25

    The modern answer, using Android Maps v2, is to use OnMapClickListener, which gives you the LatLng of a tap on the map.

    https://developer.android.com/reference/com/google/android/gms/maps/GoogleMap.OnMapClickListener.html

提交回复
热议问题