OSMDroid: Adding a marker when user taps on map

夙愿已清 提交于 2019-12-01 17:37:19

问题


I want to display a marker on map where user taps on map. Also this should not infect double tap for zooming and/or moving Mapview.

I am using osmdroid-android-4.0.jar


回答1:


Look at OSMBonusPack MapEventsOverlay/MapEventsReceiver:

http://code.google.com/p/osmbonuspack/source/browse/trunk/OSMBonusPack/src/org/osmdroid/bonuspack/overlays/MapEventsOverlay.java

You create a MapEventsOverlay, you add it to the maps overlay, and you pass it a MapEventsReceiver in which you implement your own singleTapUpHelper code.



来源:https://stackoverflow.com/questions/20946715/osmdroid-adding-a-marker-when-user-taps-on-map

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