avlsocialconnect / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Multitouch strange behavior #481

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. open activity with the map (MapView in xml)
2. zoom in/out using pinch zoom gestures

What is the expected output? What do you see instead?
Map should zoom in/out to the point between my fingers

However map sometimes "jumps" and is centered in random locations.

What version of the product are you using? On what operating system?

I'm using osmdroid-android-3.0.10.jar and testing on:

- Samsung Galaxy Ace
- LG P970

Original issue reported on code.google.com by ziem1...@gmail.com on 18 Sep 2013 at 10:49

GoogleCodeExporter commented 9 years ago
Got the smame issue.
After a pinch to zoom, map seem to pan in a random direction, as if it capture 
a touch event on one finger when getting finger off the screen.
Maybe increase the delay off MultiTouchController.EVENT_SETTLE_TIME_INTERVAL 

Original comment by jbdu...@gmail.com on 29 Jan 2014 at 2:38

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Have you found any solution for that issue? Increasing 
MultiTouchController.EVENT_SETTLE_TIME_INTERVAL didn't help. I tried to locate 
the problem with debugging but didn't find anything. If I hold the fingers for 
some time before releasing the fingers, the zoom works fine.

Original comment by t...@innovaptor.com on 7 Mar 2014 at 12:29

GoogleCodeExporter commented 9 years ago
yes, i found a solution.
Not the best, but it's work.

I extended the map, and when user stop pinch zoom, the map can't move for some 
time

http://pastebin.com/Cwady8fq

Original comment by jbdu...@gmail.com on 7 Mar 2014 at 7:33

GoogleCodeExporter commented 9 years ago
Thanks for the solution.
It's kind of a dirty hack, but it works. The issue should stay open until 
someone finds a more clean solution I guess.

Regarding your code: Since API-8 the constants you use are depricated and 
should be replaced with the new ones (e.g. ACTION_POINTER_DOWN) + 
MotionEvent.ACTION_MASK.

Original comment by t...@innovaptor.com on 10 Mar 2014 at 10:40

GoogleCodeExporter commented 9 years ago
Issue 531 has been merged into this issue.

Original comment by kurtzm...@gmail.com on 11 Mar 2014 at 3:14

GoogleCodeExporter commented 9 years ago
Yep i know, not really pretty, but it's work.
Thanks for the deprecated advice

Original comment by jbdu...@gmail.com on 11 Mar 2014 at 3:15

GoogleCodeExporter commented 9 years ago
An alternative workaround might be to  introduce a counter variable that 
ignores the first X move requests after the last zoom.

http://pastebin.com/2Zq78eSr

Ignoring the first move after a zoom seems to deal with 95% of all jump cases. 
For the rest 2 moves have to be ignored.

Not sure if this is device specific, it works on a Nexus 5.

It's still a not so pretty workaround instead of a solution.

Original comment by philipp....@gmail.com on 9 May 2014 at 1:20

GoogleCodeExporter commented 9 years ago
The onTouchEvent workaround doesn't work in the following case:
1. drag a map with one finger
2. touch by second finger and perform zoom
3. release the first finger
4. drag a map with second finger

I think some scroll state is not cleaned up after touch count change. I don't 
see a way to fix it without touching osmdroid sources. I will try it later.

Original comment by Equidamoid on 10 Sep 2014 at 8:27