fix small bugs

git-svn-id: https://osmand.googlecode.com/svn/trunk@316 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-07-10 22:46:17 +00:00
parent 97b00ef47e
commit feaf5f9d17
2 changed files with 11 additions and 3 deletions

View file

@ -59,7 +59,9 @@ public class AnimateDraggingMapThread implements Runnable {
}
}
if (!stopped && callback != null) {
callback.dragTo(curX, curY, newX, newY);
if (vx > 0 || vy > 0) {
callback.dragTo(curX, curY, newX, newY);
}
if(newZ > 0){
callback.zoomTo(newZ);
}
@ -108,6 +110,7 @@ public class AnimateDraggingMapThread implements Runnable {
} else {
dirZ = -1;
}
vx = 0;
curZ = zoomStart;
endZ = zoomEnd;
timeZ = 600;
@ -129,6 +132,9 @@ public class AnimateDraggingMapThread implements Runnable {
vy = velocityY;
dirX = (byte) (endX > startX ? 1 : -1);
dirY = (byte) (endY > startY ? 1 : -1);
curZ = 0;
endZ = 0;
timeZ = 0;
ax = vx * a;
ay = vy * a;
time = System.currentTimeMillis();

View file

@ -227,8 +227,10 @@ public class OsmandMapTileView extends SurfaceView implements IMapDownloaderCall
// for internal usage
@Override
public void zoomTo(float zoom) {
this.zoom = zoom;
refreshMap();
if (map == null || (map.getMaximumZoomSupported() >= zoom && map.getMinimumZoomSupported() <= zoom)) {
this.zoom = zoom;
refreshMap();
}
}
public void setRotate(float rotate) {