Fix display zoom out to the full route

This commit is contained in:
Victor Shcherb 2014-12-06 00:38:27 +01:00
parent c900b6d37f
commit ab5d5deeb1
2 changed files with 10 additions and 10 deletions

View file

@ -297,6 +297,9 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
if(newRoute && rh.isRoutePlanningMode() && mapView != null) {
RotatedTileBox rt = mapView.getCurrentRotatedTileBox();
Location lt = rh.getLastProjection();
if(lt == null) {
lt = app.getTargetPointsHelper().getPointToStartLocation();
}
if(lt != null) {
double left = lt.getLongitude(), right = lt.getLongitude();
double top = lt.getLatitude(), bottom = lt.getLatitude();

View file

@ -544,8 +544,8 @@ public class RoutingHelper {
return false;
}
private void setNewRoute(RouteCalculationResult res, Location start){
final boolean newRoute = !this.route.isCalculated();
private void setNewRoute(RouteCalculationResult prevRoute, RouteCalculationResult res, Location start){
final boolean newRoute = !prevRoute.isCalculated();
if (isFollowingMode) {
if(lastFixedLocation != null) {
start = lastFixedLocation;
@ -574,8 +574,7 @@ public class RoutingHelper {
if (!wrongMovementDirection || newRoute) {
voiceRouter.newRouteIsCalculated(newRoute);
}
}
app.getWaypointHelper().setNewRoute(res);
}
app.runInUIThread(new Runnable() {
@Override
public void run() {
@ -584,7 +583,7 @@ public class RoutingHelper {
}
}
});
app.getWaypointHelper().setNewRoute(res);
}
public int getLeftDistance(){
@ -737,7 +736,7 @@ public class RoutingHelper {
res = provider.recalculatePartOfflineRoute(res, params);
}
}
RouteCalculationResult prev = route;
synchronized (RoutingHelper.this) {
if (res.isCalculated()) {
route = res;
@ -748,10 +747,8 @@ public class RoutingHelper {
currentRunningJob = null;
}
if(res.isCalculated()){
setNewRoute(res, params.start);
}
if (res.isCalculated()) {
setNewRoute(prev, res, params.start);
String msg = app.getString(R.string.new_route_calculated_dist) + ": " +
OsmAndFormatter.getFormattedDistance(res.getWholeDistance(), app);
if (res.getRoutingTime() != 0f) {