Get coordinates on tapping map in android

前端 未结 6 1763
北海茫月
北海茫月 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条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-01 13:24

    Try the following.

    Write a class which derives from the Overlay class and override the onTap() method. Then you can add your overlay to the your MapView. A GeoPoint object, which represents the position of you tap, is passed to the onTap() method when you tab somewhere on the map.

提交回复
热议问题