Index: /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 10533)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 10534)
@@ -904,4 +904,7 @@
             tile = new Tile(tileSource, x, y, zoom);
             tileCache.addTile(tile);
+        }
+
+        if (!tile.isLoaded()) {
             tile.loadPlaceholderFromCache(tileCache);
         }
@@ -939,5 +942,5 @@
         EastNorth topLeft = mv.getEastNorth(0, 0);
         EastNorth botRight = mv.getEastNorth(mv.getWidth(), mv.getHeight());
-        return new TileSet(topLeft, botRight, currentZoomLevel);
+        return new MapWrappingTileSet(topLeft, botRight, currentZoomLevel);
     }
 
@@ -1197,7 +1200,31 @@
     }
 
+    private LatLon getShiftedLatLon(ICoordinate latLon) {
+        return getShiftedLatLon(Main.getProjection().latlon2eastNorth(new LatLon(latLon)));
+    }
+
+
     private final TileSet nullTileSet = new TileSet((LatLon) null, (LatLon) null, 0);
 
-    private final class TileSet {
+    private final class MapWrappingTileSet extends TileSet {
+            private MapWrappingTileSet(EastNorth topLeft, EastNorth botRight, int zoom) {
+                this(getShiftedLatLon(topLeft), getShiftedLatLon(botRight), zoom);
+            }
+
+            private MapWrappingTileSet(LatLon topLeft, LatLon botRight, int zoom) {
+                super(topLeft, botRight, zoom);
+                double centerLon = getShiftedLatLon(Main.map.mapView.getCenter()).lon();
+
+                if (topLeft.lon() > centerLon) {
+                    x0 = tileSource.getTileXMin(zoom);
+                }
+                if (botRight.lon() < centerLon) {
+                    x1 = tileSource.getTileXMax(zoom);
+                }
+                sanitize();
+            }
+    }
+
+    private class TileSet {
         int x0, x1, y0, y1;
         int zoom;
@@ -1231,13 +1258,8 @@
             x1 = t2.getXIndex();
             y1 = t2.getYIndex();
-            double centerLon = getShiftedLatLon(Main.map.mapView.getCenter()).lon();
-
-            if (topLeft.lon() > centerLon) {
-                x0 = tileSource.getTileXMin(zoom);
-            }
-            if (botRight.lon() < centerLon) {
-                x1 = tileSource.getTileXMax(zoom);
-            }
-
+            sanitize();
+        }
+
+        protected void sanitize() {
             if (x0 > x1) {
                 int tmp = x0;
@@ -1418,5 +1440,5 @@
                 TileSet ts = tileSets[zoom-minZoom];
                 if (ts == null) {
-                    ts = new TileSet(topLeft, botRight, zoom);
+                    ts = new MapWrappingTileSet(topLeft, botRight, zoom);
                     tileSets[zoom-minZoom] = ts;
                 }
@@ -1536,6 +1558,6 @@
                 }
                 Tile t2 = tempCornerTile(missed);
-                LatLon topLeft2 = new LatLon(tileSource.tileXYToLatLon(missed));
-                LatLon botRight2 = new LatLon(tileSource.tileXYToLatLon(t2));
+                LatLon topLeft2 = getShiftedLatLon(tileSource.tileXYToLatLon(missed));
+                LatLon botRight2 = getShiftedLatLon(tileSource.tileXYToLatLon(t2));
                 TileSet ts2 = new TileSet(topLeft2, botRight2, newzoom);
                 // Instantiating large TileSets is expensive.  If there
