diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 5b09233c4a..5d8a344fad 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -1075,7 +1075,9 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe mapView.setRotate(0); } routingHelper.setAppMode(settings.getApplicationMode()); - mapView.setMapPosition(settings.POSITION_ON_MAP.get()); + // mapView.setMapPosition(settings.POSITION_ON_MAP.get()); + mapView.setMapPosition(settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING ? OsmandSettings.BOTTOM_CONSTANT : + OsmandSettings.CENTER_CONSTANT); registerUnregisterSensor(getLastKnownLocation(), false); mapLayers.getMapInfoLayer().recreateControls(); mapLayers.updateLayers(mapView); @@ -1097,6 +1099,8 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe } else if(settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING){ resId = R.string.rotate_map_bearing_opt; } + mapView.setMapPosition(settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING ? OsmandSettings.BOTTOM_CONSTANT : + OsmandSettings.CENTER_CONSTANT); AccessibleToast.makeText(this, getString(resId), Toast.LENGTH_SHORT).show(); mapView.refreshMap(); diff --git a/OsmAnd/src/net/osmand/plus/extrasettings/OsmandExtraSettings.java b/OsmAnd/src/net/osmand/plus/extrasettings/OsmandExtraSettings.java index 465e4d004b..ea0b6d439d 100644 --- a/OsmAnd/src/net/osmand/plus/extrasettings/OsmandExtraSettings.java +++ b/OsmAnd/src/net/osmand/plus/extrasettings/OsmandExtraSettings.java @@ -118,28 +118,29 @@ public class OsmandExtraSettings extends OsmandPlugin { } }); - final CommonPreference posPref = view.getSettings().POSITION_ON_MAP; - final MapInfoControlRegInfo posMap = mapInfoControls.registerAppearanceWidget(R.drawable.widget_position_marker, R.string.position_on_map, - "position_on_map", textSizePref); - posMap.setStateChangeListener(new Runnable() { - @Override - public void run() { - String[] entries = new String[] { activity.getString(R.string.position_on_map_center), activity.getString(R.string.position_on_map_bottom) }; - final Integer[] vals = new Integer[] { OsmandSettings.CENTER_CONSTANT, OsmandSettings.BOTTOM_CONSTANT }; - Builder b = new AlertDialog.Builder(view.getContext()); - int i = Arrays.binarySearch(vals, posPref.get()); - b.setSingleChoiceItems(entries, i, new OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - posPref.set(vals[which]); - activity.updateApplicationModeSettings(); - view.refreshMap(true); - dialog.dismiss(); - } - }); - b.show(); - } - }); + // FIXME delete strings from this code +// final CommonPreference posPref = view.getSettings().POSITION_ON_MAP; +// final MapInfoControlRegInfo posMap = mapInfoControls.registerAppearanceWidget(R.drawable.widget_position_marker, R.string.position_on_map, +// "position_on_map", textSizePref); +// posMap.setStateChangeListener(new Runnable() { +// @Override +// public void run() { +// String[] entries = new String[] { activity.getString(R.string.position_on_map_center), activity.getString(R.string.position_on_map_bottom) }; +// final Integer[] vals = new Integer[] { OsmandSettings.CENTER_CONSTANT, OsmandSettings.BOTTOM_CONSTANT }; +// Builder b = new AlertDialog.Builder(view.getContext()); +// int i = Arrays.binarySearch(vals, posPref.get()); +// b.setSingleChoiceItems(entries, i, new OnClickListener() { +// @Override +// public void onClick(DialogInterface dialog, int which) { +// posPref.set(vals[which]); +// activity.updateApplicationModeSettings(); +// view.refreshMap(true); +// dialog.dismiss(); +// } +// }); +// b.show(); +// } +// }); } @Override