From a8dcdd70c40afef5f597fd7227ac3d6603c193b3 Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 3 Nov 2014 16:13:23 +0200 Subject: [PATCH 1/2] Max zoom can't be more than 22 --- OsmAnd/src/net/osmand/plus/activities/MapActivity.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 6ca04420e0..d8464b3676 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -462,6 +462,10 @@ public class MapActivity extends AccessibleActivity implements // changeLocation = false; // } final int newZoom = mapView.getZoom() + stp; + if (newZoom > 22) { + AccessibleToast.makeText(this, "Max zoom", Toast.LENGTH_SHORT).show(); //$NON-NLS-1$ + return; + } mapView.getAnimatedDraggingThread().startZooming(newZoom, changeLocation); if (app.accessibilityEnabled()) AccessibleToast.makeText(this, getString(R.string.zoomIs) + " " + newZoom, Toast.LENGTH_SHORT).show(); //$NON-NLS-1$ From f427197186a126296dbab83527e26d1446629827 Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 3 Nov 2014 18:06:53 +0200 Subject: [PATCH 2/2] Used string from resouces --- OsmAnd/src/net/osmand/plus/activities/MapActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index d8464b3676..5842a706bd 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -463,7 +463,7 @@ public class MapActivity extends AccessibleActivity implements // } final int newZoom = mapView.getZoom() + stp; if (newZoom > 22) { - AccessibleToast.makeText(this, "Max zoom", Toast.LENGTH_SHORT).show(); //$NON-NLS-1$ + AccessibleToast.makeText(this, R.string.edit_tilesource_maxzoom, Toast.LENGTH_SHORT).show(); //$NON-NLS-1$ return; } mapView.getAnimatedDraggingThread().startZooming(newZoom, changeLocation);