Maz zoom for gestures now the same as for buttons. #2648

This commit is contained in:
GaidamakUA 2016-06-10 12:16:40 +03:00
parent 19e4338926
commit 88c4ec9094
3 changed files with 4 additions and 3 deletions

View file

@ -51,7 +51,7 @@
android:id="@+id/map_transparency_layout" android:id="@+id/map_transparency_layout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|center" android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="@dimen/map_button_size" android:layout_marginBottom="@dimen/map_button_size"
android:orientation="horizontal"> android:orientation="horizontal">

View file

@ -119,6 +119,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
private static final int LONG_KEYPRESS_DELAY = 500; private static final int LONG_KEYPRESS_DELAY = 500;
private static final Log LOG = PlatformUtil.getLog(MapActivity.class); private static final Log LOG = PlatformUtil.getLog(MapActivity.class);
public static final int MAX_ZOOM = 22;
private static MapViewTrackingUtilities mapViewTrackingUtilities; private static MapViewTrackingUtilities mapViewTrackingUtilities;
private static MapContextMenu mapContextMenu = new MapContextMenu(); private static MapContextMenu mapContextMenu = new MapContextMenu();
@ -795,7 +796,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
final int newZoom = mapView.getZoom() + stp; final int newZoom = mapView.getZoom() + stp;
final double zoomFrac = mapView.getZoomFractionalPart(); final double zoomFrac = mapView.getZoomFractionalPart();
if (newZoom > 22) { if (newZoom > MAX_ZOOM) {
Toast.makeText(this, R.string.edit_tilesource_maxzoom, Toast.LENGTH_SHORT).show(); //$NON-NLS-1$ Toast.makeText(this, R.string.edit_tilesource_maxzoom, Toast.LENGTH_SHORT).show(); //$NON-NLS-1$
return; return;
} }

View file

@ -408,7 +408,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
public void setMainLayer(BaseMapLayer mainLayer) { public void setMainLayer(BaseMapLayer mainLayer) {
this.mainLayer = mainLayer; this.mainLayer = mainLayer;
int zoom = currentViewport.getZoom(); int zoom = currentViewport.getZoom();
maxZoom = mainLayer.getMaximumShownMapZoom(); maxZoom = MapActivity.MAX_ZOOM;
minZoom = mainLayer.getMinimumShownMapZoom() + 1; minZoom = mainLayer.getMinimumShownMapZoom() + 1;
if (maxZoom < zoom) { if (maxZoom < zoom) {
zoom = maxZoom; zoom = maxZoom;