aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2014-10-11 13:50:45 +0200
committerBananeweizen <bananeweizen@gmx.de>2014-10-11 13:50:45 +0200
commit46149f85dc114f071884799be641398c9620ec87 (patch)
treee3abe6a6c2832164cffa9d40646d94d8b37e3793
parentbcdf96d57561819eba2a93f18a1e0dea342c3053 (diff)
downloadcgeo-46149f85dc114f071884799be641398c9620ec87.zip
cgeo-46149f85dc114f071884799be641398c9620ec87.tar.gz
cgeo-46149f85dc114f071884799be641398c9620ec87.tar.bz2
fix #659: limit initial zoom level of live map
-rw-r--r--main/src/cgeo/geocaching/settings/Settings.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/settings/Settings.java b/main/src/cgeo/geocaching/settings/Settings.java
index 3f9c0a5..4713594 100644
--- a/main/src/cgeo/geocaching/settings/Settings.java
+++ b/main/src/cgeo/geocaching/settings/Settings.java
@@ -50,6 +50,10 @@ import java.util.Locale;
*/
public class Settings {
+ /**
+ * On opening a map, we limit the _initial_ zoom. The user can still zoom out afterwards.
+ */
+ private static final int INITIAL_MAP_ZOOM_LIMIT = 16;
private static final char HISTORY_SEPARATOR = ',';
public static final int SHOW_WP_THRESHOLD_DEFAULT = 10;
public static final int SHOW_WP_THRESHOLD_MAX = 50;
@@ -653,7 +657,7 @@ public class Settings {
* @return zoom used for the (live) map
*/
private static int getMapZoom() {
- return getInt(R.string.pref_lastmapzoom, 14);
+ return Math.min(getInt(R.string.pref_lastmapzoom, 14), INITIAL_MAP_ZOOM_LIMIT);
}
private static void setMapZoom(final int mapZoomLevel) {
@@ -664,7 +668,7 @@ public class Settings {
* @return zoom used for the map of a single cache
*/
private static int getCacheZoom() {
- return getInt(R.string.pref_cache_zoom, 14);
+ return Math.min(getInt(R.string.pref_cache_zoom, 14), INITIAL_MAP_ZOOM_LIMIT);
}
private static void setCacheZoom(final int zoomLevel) {