Index: trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 13673)
+++ trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 13674)
@@ -1208,16 +1208,8 @@
 
         protected void sanitize() {
-            if (minX < tileSource.getTileXMin(zoom)) {
-                minX = tileSource.getTileXMin(zoom);
-            }
-            if (minY < tileSource.getTileYMin(zoom)) {
-                minY = tileSource.getTileYMin(zoom);
-            }
-            if (maxX > tileSource.getTileXMax(zoom)) {
-                maxX = tileSource.getTileXMax(zoom);
-            }
-            if (maxY > tileSource.getTileYMax(zoom)) {
-                maxY = tileSource.getTileYMax(zoom);
-            }
+            minX = Utils.clamp(minX, tileSource.getTileXMin(zoom), tileSource.getTileXMax(zoom));
+            maxX = Utils.clamp(maxX, tileSource.getTileXMin(zoom), tileSource.getTileXMax(zoom));
+            minY = Utils.clamp(minY, tileSource.getTileYMin(zoom), tileSource.getTileYMax(zoom));
+            maxY = Utils.clamp(maxY, tileSource.getTileYMin(zoom), tileSource.getTileYMax(zoom));
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java	(revision 13673)
+++ trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java	(revision 13674)
@@ -18,4 +18,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;
+import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.imagery.AbstractWMSTileSource;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
@@ -28,4 +29,5 @@
 import org.openstreetmap.josm.data.projection.Projection;
 import org.openstreetmap.josm.data.projection.Projections;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.imagery.TileSourceDisplaySettings;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
@@ -130,16 +132,35 @@
             return requested;
         } else {
+            LatLon center = MainApplication.isDisplayingMapView() ?
+                    requested.eastNorth2latlon(MainApplication.getMap().mapView.getCenter()) : null;
+            Projection firstNonNullproj = null;
+            Projection firstProjInBounds = null;
             for (String code : serverProjections) {
                 Projection proj = Projections.getProjectionByCode(code);
                 if (proj != null) {
-                    Logging.info(tr("Reprojecting layer {0} from {1} to {2}. For best image quality and performance,"
-                            + " switch to one of the supported projections: {3}",
-                            getName(), proj.toCode(), Main.getProjection().toCode(), Utils.join(", ", getNativeProjections())));
-                    return proj;
+                    if (firstNonNullproj == null) {
+                        firstNonNullproj = proj;
+                    }
+                    if (center != null && proj.getWorldBoundsLatLon().contains(center)) {
+                        firstProjInBounds = proj;
+                        break;
+                    }
                 }
+            }
+            if (firstProjInBounds != null) {
+                return selectProjection(firstProjInBounds);
+            } else if (firstNonNullproj != null) {
+                return selectProjection(firstNonNullproj);
             }
             Logging.warn(tr("Unable to find supported projection for layer {0}. Using {1}.", getName(), requested.toCode()));
             return requested;
         }
+    }
+
+    private Projection selectProjection(Projection proj) {
+        Logging.info(tr("Reprojecting layer {0} from {1} to {2}. For best image quality and performance,"
+                + " switch to one of the supported projections: {3}",
+                getName(), proj.toCode(), Main.getProjection().toCode(), Utils.join(", ", getNativeProjections())));
+        return proj;
     }
 
