From c910b7127fbd45856456d155facbcc57b5e29e02 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Fri, 6 Oct 2017 11:54:40 +0300 Subject: [PATCH] Change map center in plan route mode in landscape --- .../net/osmand/plus/mapmarkers/PlanRouteFragment.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java index 80beed8403..e13509f0f1 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java @@ -65,6 +65,8 @@ import java.util.Map; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; +import static net.osmand.plus.OsmandSettings.LANDSCAPE_MIDDLE_RIGHT_CONSTANT; + public class PlanRouteFragment extends Fragment { public static final String TAG = "PlanRouteFragment"; @@ -436,6 +438,12 @@ public class PlanRouteFragment extends Fragment { } setupAppModesBtn(); + OsmandMapTileView tileView = mapActivity.getMapView(); + previousMapPosition = tileView.getMapPosition(); + if (!portrait) { + tileView.setMapPosition(LANDSCAPE_MIDDLE_RIGHT_CONSTANT); + } + selectedCount = mapActivity.getMyApplication().getMapMarkersHelper().getSelectedMarkersCount(); recreateSnapTrkSegment(); mapActivity.refreshMap(); @@ -491,6 +499,8 @@ public class PlanRouteFragment extends Fragment { mapActivity.findViewById(R.id.snap_to_road_image_button).setVisibility(View.GONE); mainView.findViewById(R.id.snap_to_road_progress_bar).setVisibility(View.GONE); + mapActivity.getMapView().setMapPosition(previousMapPosition); + cancelSnapToRoad(); markersLayer.setRoute(null); mapActivity.refreshMap();