Index: /trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java	(revision 11843)
+++ /trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java	(revision 11844)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.data.coor;
 
+import org.openstreetmap.gui.jmapviewer.Projected;
 import org.openstreetmap.gui.jmapviewer.interfaces.IProjected;
 
@@ -181,4 +182,8 @@
     }
 
+    public IProjected toProjected() {
+        return new Projected(east(), north());
+    }
+
     @Override
     public String toString() {
Index: /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 11843)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 11844)
@@ -64,4 +64,5 @@
 import org.openstreetmap.gui.jmapviewer.MemoryTileCache;
 import org.openstreetmap.gui.jmapviewer.OsmTileLoader;
+import org.openstreetmap.gui.jmapviewer.Projected;
 import org.openstreetmap.gui.jmapviewer.Tile;
 import org.openstreetmap.gui.jmapviewer.TileAnchor;
@@ -984,5 +985,5 @@
     private TileSet getVisibleTileSet() {
         ProjectionBounds bounds = Main.map.mapView.getState().getViewArea().getProjectionBounds();
-        return getTileSet(bounds.getMin(), bounds.getMax(), currentZoomLevel);
+        return getTileSet(bounds, currentZoomLevel);
     }
 
@@ -1258,5 +1259,5 @@
     private final TileSet nullTileSet = new TileSet();
 
-    private class TileSet extends TileRange {
+    protected class TileSet extends TileRange {
 
         protected TileSet(TileXY t1, TileXY t2, int zoom) {
@@ -1394,28 +1395,13 @@
     /**
      * Create a TileSet by EastNorth bbox taking a layer shift in account
-     * @param topLeft top-left lat/lon
-     * @param botRight bottom-right lat/lon
+     * @param bounds the EastNorth bounds
      * @param zoom zoom level
      * @return the tile set
-     * @since 10651
-     */
-    protected TileSet getTileSet(EastNorth topLeft, EastNorth botRight, int zoom) {
-        return getTileSet(getShiftedLatLon(topLeft), getShiftedLatLon(botRight), zoom);
-    }
-
-    /**
-     * Create a TileSet by known LatLon bbox without layer shift correction
-     * @param topLeft top-left lat/lon
-     * @param botRight bottom-right lat/lon
-     * @param zoom zoom level
-     * @return the tile set
-     * @since 10651
-     */
-    protected TileSet getTileSet(LatLon topLeft, LatLon botRight, int zoom) {
-        if (zoom == 0)
-            return new TileSet();
-
-        TileXY t1 = tileSource.latLonToTileXY(topLeft.toCoordinate(), zoom);
-        TileXY t2 = tileSource.latLonToTileXY(botRight.toCoordinate(), zoom);
+     */
+    protected TileSet getTileSet(ProjectionBounds bounds, int zoom) {
+        EastNorth topLeftUnshifted = coordinateConverter.shiftDisplayToServer(bounds.getMin());
+        EastNorth botRightUnshifted = coordinateConverter.shiftDisplayToServer(bounds.getMax());
+        TileXY t1 = tileSource.projectedToTileXY(topLeftUnshifted.toProjected(), zoom);
+        TileXY t2 = tileSource.projectedToTileXY(botRightUnshifted.toProjected(), zoom);
         return new TileSet(t1, t2, zoom);
     }
@@ -1472,5 +1458,5 @@
                 TileSet ts = tileSets[zoom-minZoom];
                 if (ts == null) {
-                    ts = AbstractTileSourceLayer.this.getTileSet(bounds.getMin(), bounds.getMax(), zoom);
+                    ts = AbstractTileSourceLayer.this.getTileSet(bounds, zoom);
                     tileSets[zoom-minZoom] = ts;
                 }
@@ -1657,9 +1643,6 @@
             Main.debug("getTileForPixelpos("+px+", "+py+')');
         }
-        MapView mv = Main.map.mapView;
         Point clicked = new Point(px, py);
-        EastNorth topLeft = mv.getEastNorth(0, 0);
-        EastNorth botRight = mv.getEastNorth(mv.getWidth(), mv.getHeight());
-        TileSet ts = getTileSet(topLeft, botRight, currentZoomLevel);
+        TileSet ts = getVisibleTileSet();
 
         if (!ts.tooLarge()) {
Index: /trunk/src/org/openstreetmap/josm/gui/layer/imagery/TileCoordinateConverter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/imagery/TileCoordinateConverter.java	(revision 11843)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/imagery/TileCoordinateConverter.java	(revision 11844)
@@ -48,4 +48,14 @@
     private MapViewPoint pos(IProjected p) {
         return mapView.getState().getPointFor(new EastNorth(p)).add(settings.getDisplacement());
+    }
+
+    /**
+     * Apply reverse shift to EastNorth coordinate.
+     *
+     * @param en EastNorth coordinate representing a pixel on screen
+     * @return EastNorth coordinate as it would e.g. be sent to a WMS server
+     */
+    public EastNorth shiftDisplayToServer(EastNorth en) {
+        return en.subtract(settings.getDisplacement());
     }
 
