Index: /applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapLayer.java
===================================================================
--- /applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapLayer.java	(revision 13920)
+++ /applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapLayer.java	(revision 13921)
@@ -12,5 +12,4 @@
 import java.awt.event.MouseEvent;
 import java.awt.image.ImageObserver;
-import java.util.ArrayList;
 import java.util.HashMap;
 
@@ -322,4 +321,6 @@
         g.setColor(Color.DARK_GRAY);
 
+        float fadeBackground = SlippyMapPreferences.getFadeBackground();
+        
         for (int x = z12x0 - 1; x <= z12x1; x++)
         {
@@ -351,7 +352,13 @@
                     Point p2 = pixelpos[x - z12x0 + 2][y - z12y0 + 2];
                     g.drawImage(img, p.x, p.y, p2.x - p.x, p2.y - p.y, this);
-                }
-            }
-        }
+                    
+                    if(fadeBackground != 0f) {
+	                    //dimm by painting opaque rect...
+	                    g.setColor(new Color(1f,1f,1f,fadeBackground));
+	                    g.fillRect(p.x, p.y, p2.x - p.x, p2.y - p.y);
+                    }//end of if dim != 0
+                }//end of if img != null
+            }//end of for
+        }//end of for
 
         for (int x = z12x0 - 1; x <= z12x1; x++)
@@ -374,4 +381,7 @@
                 int texty = p.y + 2 + fontHeight;
                 SlippyMapTile tile = tileStorage[currentZoomLevel].get(key);
+                if(tile == null) {
+                	continue;
+                }
                 p = pixelpos[x - z12x0 + 1][y - z12y0 + 2];
                 g.drawString("x=" + x + " y=" + y + " z=" + currentZoomLevel + "", p.x + 2, texty);
@@ -408,5 +418,5 @@
                     }
                 }
-            }
+            } //end of for
         }
 
Index: /applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapPreferenceSetting.java
===================================================================
--- /applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapPreferenceSetting.java	(revision 13920)
+++ /applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapPreferenceSetting.java	(revision 13921)
@@ -8,4 +8,5 @@
 import javax.swing.JLabel;
 import javax.swing.JPanel;
+import javax.swing.JSlider;
 import javax.swing.JSpinner;
 
@@ -29,4 +30,5 @@
     private JCheckBox autoloadTiles = new JCheckBox(tr("autoload tiles"));
     private JSpinner maxZoomLvl = new JSpinner();
+    private JSlider fadeBackground = new JSlider(0, 100);
 
     public void addGui(PreferenceDialog gui)
@@ -60,8 +62,14 @@
         maxZoomLvlPanel.add(this.maxZoomLvl, GBC.eol().fill(GBC.HORIZONTAL));
         
+        JPanel fadeBackgroundPanel = new JPanel();
+        fadeBackgroundPanel.add(new JLabel(tr("Fade background: ")), GBC.std());
+        fadeBackgroundPanel.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));
+        fadeBackgroundPanel.add(this.fadeBackground, GBC.eol().fill(GBC.HORIZONTAL));
+        
         slippymapTab.add(mapUrlPanel, GBC.eol().fill(GBC.HORIZONTAL));
         slippymapTab.add(autozoomPanel, GBC.eol().fill(GBC.HORIZONTAL));
         slippymapTab.add(autoloadPanel, GBC.eol().fill(GBC.HORIZONTAL));
         slippymapTab.add(maxZoomLvlPanel, GBC.eol().fill(GBC.HORIZONTAL));
+        slippymapTab.add(fadeBackgroundPanel, GBC.eol().fill(GBC.HORIZONTAL));
         slippymapTab.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
         
@@ -84,4 +92,5 @@
         this.autoloadTiles.setSelected(SlippyMapPreferences.getAutoloadTiles());
         this.maxZoomLvl.setValue(SlippyMapPreferences.getMaxZoomLvl());
+        this.fadeBackground.setValue(Math.round(SlippyMapPreferences.getFadeBackground()*100f));
     }
     
@@ -100,4 +109,5 @@
         SlippyMapPreferences.setAutoloadTiles(this.autoloadTiles.isSelected());
         SlippyMapPreferences.setMaxZoomLvl((Integer)this.maxZoomLvl.getValue());
+        SlippyMapPreferences.setFadeBackground(this.fadeBackground.getValue()/100f);
         //restart isn't required
         return false;
Index: /applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapPreferences.java
===================================================================
--- /applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapPreferences.java	(revision 13920)
+++ /applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapPreferences.java	(revision 13921)
@@ -18,4 +18,5 @@
     private static final String PREFERENCE_AUTOLOADTILES = PREFERENCE_PREFIX + ".autoload_tiles";
     private static final String PREFERENCE_MAX_ZOOM_LVL = PREFERENCE_PREFIX + ".max_zoom_lvl";
+    private static final String PREFERENCE_FADE_BACKGROUND = PREFERENCE_PREFIX + ".fade_background";
     
     public static String getMapUrl()
@@ -66,8 +67,44 @@
     }
     
+    public static void setFadeBackground(float fadeBackground) {
+    	Main.pref.put(SlippyMapPreferences.PREFERENCE_FADE_BACKGROUND, fadeBackground + "");
+    }
+
+    /**
+     * 
+     * @return	number between 0 and 1, inclusive
+     */
+    public static float getFadeBackground() {
+        String fadeBackground = Main.pref.get(PREFERENCE_FADE_BACKGROUND);
+
+        if (fadeBackground == null || "".equals(fadeBackground))
+        {
+        	fadeBackground = "0.0";
+            Main.pref.put(PREFERENCE_FADE_BACKGROUND, fadeBackground);
+        }
+        
+        float parsed;
+        try {
+        	parsed = Float.parseFloat(fadeBackground);
+        } catch (Exception ex) {
+        	setFadeBackground(0.1f);
+        	System.out.println("Error while parsing setting fade background to float! returning 0.1, because of error:");
+        	ex.printStackTrace(System.out);
+        	return 0.1f;
+        }
+        if(parsed < 0f) {
+        	parsed = 0f;
+        } else {
+        	if(parsed > 1f) {
+            	parsed = 1f;
+            }
+        }
+        return parsed;
+    }
+    
     public static void setAutoloadTiles(boolean autoloadTiles) {
     	Main.pref.put(SlippyMapPreferences.PREFERENCE_AUTOLOADTILES, autoloadTiles);
     }
-
+    
     public static int getMaxZoomLvl()
     {
