Unable to implement onTouchEvent (Drag & Drop) with Osmdroid

爱⌒轻易说出口 提交于 2019-12-02 01:47:29

I got the above code working. I only noticed two things different between my working code and yours. One is the hitTest paramaters you are sending, try changing

if (hitTest(item, defaultMarker, x - p.x, y - p.y)) {

to

if (hitTest(item, defaultMarker, t.x - p.x, t.y - p.y)) {

The second is that you should uncomment pj.fromMapPixels(x, y, t);

also you should probably uncomment dragImage.setVisibility(View.VISIBLE); if you want to see the image as you are dragging it

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