From 73a4e947731b81192072f5e07e1212bc8e8309f5 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Wed, 26 Mar 2014 23:51:35 +0100 Subject: [PATCH] Fix small issue --- .../net/osmand/plus/base/MapViewTrackingUtilities.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index 77f65cb850..8048e22e71 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -291,17 +291,19 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc List list = app.getTargetPointsHelper().getIntermediatePointsWithTarget(); for(LatLon l : list) { left = Math.min(left, l.getLongitude()); - right = Math.max(left, l.getLongitude()); + right = Math.max(right, l.getLongitude()); top = Math.max(top, l.getLatitude()); bottom = Math.min(bottom, l.getLatitude()); } RotatedTileBox tb = new RotatedTileBox(rt); tb.setPixelDimensions(2 * tb.getPixWidth() / 3, 2 * tb.getPixHeight() / 3); - tb.setLatLonCenter(bottom / 2 + top / 2, left / 2 + right / 2); + double clat = bottom / 2 + top / 2; + double clon = left / 2 + right / 2; + tb.setLatLonCenter(clat, clon); while(tb.getZoom() >= 7 && (!tb.containsLatLon(top, left) || !tb.containsLatLon(bottom, right))) { tb.setZoom(tb.getZoom() - 1); } - mapView.getAnimatedDraggingThread().startMoving(tb.getLatitude(), tb.getLongitude(), tb.getZoom(), + mapView.getAnimatedDraggingThread().startMoving(clat, clon, tb.getZoom(), true); } }