Open GoogleCodeExporter opened 8 years ago
Hi,
I was at a similar situation - conflict between map view animateTo and zoom
animation.
You can find a temporary solution at
http://code.google.com/p/osmdroid/issues/detail?id=391
Regards.
Original comment by devemu...@gmail.com
on 9 Jul 2013 at 4:05
Maybe we should cancel any running map panning animations when we start a zoom
animation.
We could alternately adjust the final destination of the pan animation to be
valid for the new zoom level, however if zooming in you would lose some
resolution and might not land in the exact right spot.
Original comment by kurtzm...@gmail.com
on 9 Jul 2013 at 6:04
Interestingly - this should be handled properly. When zooming in:
1. The animation starts. The maps stay at the current zoom level.
2. The view increases in scale until it is at 2.0x. The animation ends.
3. The maps call setZoomLevel() to the new zoom level.
4. setZoomLevel() halts all panning animation where it is at.
5. setZoomLevel() adjusts the scroll position for the new zoom level.
So what *should* happen in the situation you describe is something along the
lines of:
1. The onLocationChanged() fires, and the maps start to pan towards your
current location.
2. During the animation you tap the zoom-in button.
3. The scroller stops panning where it is at.
4. The maps zoom in.
5. You end up half-way in between your starting location and your destination
location.
But it sounds like you end up completely in the wrong location that isn't along
the path between your starting and destination location correct? That sounds
like the scroll values are not getting translated from the old zoom level to
the new zoom level, but it could be something else.
I wonder if you remove lines 979 and 981 from MapView.computeScroll():
scrollTo(mScroller.getCurrX(), mScroller.getCurrY());
setZoomLevel(mZoomLevel);
Does that fix the problem? There is a chance that the last scrollTo() puts
those x/y values for the old zoom level into the new zoom level.
Original comment by kurtzm...@gmail.com
on 10 Jul 2013 at 9:51
Issue 391 has been merged into this issue.
Original comment by kurtzm...@gmail.com
on 10 Jul 2013 at 9:53
Hi kurtzmarc,
You propably mean lines 967 and 969 at MapView.computeScroll() from the latest
trunk.
I removed them but the problem still exists.
Regards.
Original comment by devemu...@gmail.com
on 11 Jul 2013 at 6:49
Please take a look at the patch in issue 453. It changes the way we do zoom in
and out animations and it may affect the issue here. I think the new code is
simpler and hopefully as a side-effect, it fixes this issue.
Original comment by kurtzm...@gmail.com
on 6 Aug 2013 at 7:16
Original issue reported on code.google.com by
armellin...@gmail.com
on 9 Jul 2013 at 2:26