>From the code comment:

In general, smaller zoom levels are more readable.  We prefer big,
block, pixelated (but readable) map text to small, smeared,
unreadable underzoomed text.  So, use .floor() instead of rounding
to skew things a bit toward the lower zooms.

The second hunk changes the range in which we start looking for an
autozoom.  The old code was fairly picky about when it tried to change
autozoom levels.  It was expensive to calculate.  The new code is _much_
nicer and cleaner.  But, it also removed some code that tended to let it
autozoom sooner.  The end result is that we are sticking with high zoom
levels too aggressively which leads to quite unreadable text.  This
tweaks the pixelScaling limits to go looking for more autozoom levels
more often.

-- Dave
Index: gui/layer/TMSLayer.java
===================================================================
--- gui/layer/TMSLayer.java	(revision 4323)
+++ gui/layer/TMSLayer.java	(working copy)
@@ -310,7 +310,11 @@
     private int getBestZoom() {
         double factor = getScaleFactor(1);
         double result = Math.log(factor)/Math.log(2)/2+1;
-        int intResult = (int)Math.round(result);
+        // In general, smaller zoom levels are more readable.  We prefer big,
+        // block, pixelated (but readable) map text to small, smeared,
+        // unreadable underzoomed text.  So, use .floor() instead of rounding
+        // to skew things a bit toward the lower zooms.
+        int intResult = (int)Math.floor(result);
         if (intResult > getMaxZoomLvl())
             return getMaxZoomLvl();
         if (intResult < getMinZoomLvl())
@@ -1129,7 +1133,7 @@
         int zoom = currentZoomLevel;
         if (autoZoom) {
             double pixelScaling = getScaleFactor(zoom);
-            if (pixelScaling > 3 || pixelScaling < 0.45) {
+            if (pixelScaling > 3 || pixelScaling < 0.7) {
                 zoom = getBestZoom();
             }
         }
_______________________________________________
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev

Reply via email to