-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Endless onScroll calls #164
Comments
is this on 4.3 or off of master? |
on 4.3 |
On both. Made for master version: https://github.com/hakami1024/osmdroid |
Ahh i see you mean. Looks like the map listener is being called a number of times when mMapView.getController().animateTo(...); is called... is this really a "problem"? |
After clicking only "My location" there is some calls, that is not a problem. If you click "My location" and then one of zoom buttons (and nothing more), does then the onScroll stop being called after some time? |
so here's what the stack trace looks like. not clear was going on...
|
the on scroll events appear to stop if you pan the map around, however the ui appears to hang for at least a few seconds or several touch events. I also tried with MapController.setCenter, same behavior |
looks like @kurtzmarc wrote most of the code related to this. Maybe he has some insight as to what's going on |
I haven't had a chance to debug this so I haven't witnessed it myself yet. So this is triggered by an animateTo() followed by pressing one of the zoom buttons. Are the maps "settled" from the animation when you hit the zoom button or are they still animating? Does it matter whether you zoom in or zoom out? Are the endless onScroll() calls originating from computeScroll() (a function of the Scroller and animation) or are they just onScroll()? |
Endless onScroll() calls are originating from computeScroll(). Animation state and zoom direction didn't make any difference. |
@hakami1024 i just pushed a driver for this issue. I know at one point i was able to reproduce, but i can't reproduce right now with the emulator. Can you check out and see if you can reproduce it when the new driver? pushed to master |
I have got the problem of endless onScroll() calls. I have found that, MyLocationNewOverlay-->setLocation, "mMapView.getProjection().toProjectedPixels((int) (mLocation.getLatitude() * 1E6), (int) (mLocation.getLongitude() * 1E6), mMapCoordsProjected);", once this code is executed, the zoom in/out action can cause the endless onScroll calls problem. |
@hakami1024 @windmly osmdroid's management of zoom levels, animations and projections dramatically changed in the past months. Is this issue still relevant or can we close it? |
I edited my "Proof-of-bug" application for osmdroid 6.0.2 and tested on Android 4.4.2. No bug. Thanks! |
The problem is quite similar to this one: https://code.google.com/p/android/issues/detail?id=43120
so I downloaded and adapted for osm it's sample: https://github.com/hakami1024/computescrollbug/blob/master/app/src/main/java/biz/thomaskeller/android/computescrollbug/MainActivity.java.
The difference is that the zooming itself doesn't cause the problem. The endless onScroll calls begin only if zoom was after animating to some location (maybe exactly MyLocation). And the calls stop after real scrolling.
The text was updated successfully, but these errors were encountered: