Android tap on map and get coordinates

前端 未结 3 1605
北海茫月
北海茫月 2021-01-13 13:25

Hi guys I am trying to make an app that once the user taps on a map it gets the coordinates of that specific point.

Among others i have also read that: Get coordina

3条回答
  •  星月不相逢
    2021-01-13 14:20

    Should be trivial with a little bit of math. You can use getLatitudeSpan() and getLongitudeSpan() to get the extents of the visible map, and getMapCenter() to see the center point. Just map that to the coordinates of the touch event.

    EDIT: Mark, as always, has an even more elegant solution.

提交回复
热议问题