diff --git a/OsmAnd/src/com/osmand/views/AnimateDraggingMapThread.java b/OsmAnd/src/com/osmand/views/AnimateDraggingMapThread.java index 87a39472c6..d89c29d952 100644 --- a/OsmAnd/src/com/osmand/views/AnimateDraggingMapThread.java +++ b/OsmAnd/src/com/osmand/views/AnimateDraggingMapThread.java @@ -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(); diff --git a/OsmAnd/src/com/osmand/views/OsmandMapTileView.java b/OsmAnd/src/com/osmand/views/OsmandMapTileView.java index 0751563fba..8b05a242bb 100644 --- a/OsmAnd/src/com/osmand/views/OsmandMapTileView.java +++ b/OsmAnd/src/com/osmand/views/OsmandMapTileView.java @@ -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) {