From 72a4ae7158d102a8f178e88e0c449f4d0d97a4b4 Mon Sep 17 00:00:00 2001 From: sonora Date: Tue, 13 Mar 2012 20:13:24 +0100 Subject: [PATCH] try alternative speed/zoome hysteresis prevention, solves bug that zoom is not adjusted in many cases wher adjustment by 1 is needed --- OsmAnd/src/net/osmand/plus/activities/MapActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 37e00ecacf..29f7b10e8d 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -713,7 +713,7 @@ public class MapActivity extends TrackedActivity implements IMapLocationListener if(mapView.getZoom() != z && !mapView.mapIsAnimating()){ long now = System.currentTimeMillis(); // prevent ui hysterisis (check time interval for autozoom) - if(Math.abs(mapView.getZoom() - z) > 1 || (lastTimeAutoZooming - now) > 6500){ + if((lastTimeAutoZooming - now) > 6500){ lastTimeAutoZooming = now; mapView.setZoom(z); } @@ -740,10 +740,10 @@ public class MapActivity extends TrackedActivity implements IMapLocationListener public int defineZoomFromSpeed(float speed, int currentZoom){ speed *= 3.6; - if(speed < 4){ + if(speed < 5){ return currentZoom; + // less than 23: show zoom 17 } else if(speed < 23){ - // less than 23 - show 17 return 17; } else if(speed < 43){ return 16;