Change map center in plan route mode in landscape

This commit is contained in:
Alexander Sytnyk 2017-10-06 11:54:40 +03:00
parent f8fb7279d6
commit c910b7127f

View file

@ -65,6 +65,8 @@ import java.util.Map;
import java.util.Queue; import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ConcurrentLinkedQueue;
import static net.osmand.plus.OsmandSettings.LANDSCAPE_MIDDLE_RIGHT_CONSTANT;
public class PlanRouteFragment extends Fragment { public class PlanRouteFragment extends Fragment {
public static final String TAG = "PlanRouteFragment"; public static final String TAG = "PlanRouteFragment";
@ -436,6 +438,12 @@ public class PlanRouteFragment extends Fragment {
} }
setupAppModesBtn(); setupAppModesBtn();
OsmandMapTileView tileView = mapActivity.getMapView();
previousMapPosition = tileView.getMapPosition();
if (!portrait) {
tileView.setMapPosition(LANDSCAPE_MIDDLE_RIGHT_CONSTANT);
}
selectedCount = mapActivity.getMyApplication().getMapMarkersHelper().getSelectedMarkersCount(); selectedCount = mapActivity.getMyApplication().getMapMarkersHelper().getSelectedMarkersCount();
recreateSnapTrkSegment(); recreateSnapTrkSegment();
mapActivity.refreshMap(); mapActivity.refreshMap();
@ -491,6 +499,8 @@ public class PlanRouteFragment extends Fragment {
mapActivity.findViewById(R.id.snap_to_road_image_button).setVisibility(View.GONE); mapActivity.findViewById(R.id.snap_to_road_image_button).setVisibility(View.GONE);
mainView.findViewById(R.id.snap_to_road_progress_bar).setVisibility(View.GONE); mainView.findViewById(R.id.snap_to_road_progress_bar).setVisibility(View.GONE);
mapActivity.getMapView().setMapPosition(previousMapPosition);
cancelSnapToRoad(); cancelSnapToRoad();
markersLayer.setRoute(null); markersLayer.setRoute(null);
mapActivity.refreshMap(); mapActivity.refreshMap();