Index: applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/Constants.java
===================================================================
--- applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/Constants.java	(revision 5685)
+++ 	(revision )
@@ -1,13 +1,0 @@
-package org.openstreetmap.josm.plugins.slippymap;
-
-
-/**
- * String constants
- * 
- * @author Hakan Tandogan <hakan@gurkensalat.com>
- * 
- */
-public interface Constants
-{
-    public static String PREFERENCE_PREFIX = "slippymap";
-}
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 5685)
+++ applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapLayer.java	(revision 5689)
@@ -186,5 +186,11 @@
             {
                 int key = (y << 19) + x;
+
                 SlippyMapTile tile = tileStorage.get(12).get(key);
+
+                if (tile == null)
+                    tileStorage.get(12).put(key,
+                            tile = new SlippyMapTile(x, y, 12));
+
                 if (tile.getImage() == null)
                     tile.loadImage();
@@ -466,5 +472,5 @@
     public void preferenceChanged(String key, String newValue)
     {
-        if (key.startsWith(Constants.PREFERENCE_PREFIX))
+        if (key.startsWith(SlippyMapPreferences.PREFERENCE_PREFIX))
         {
             System.err.println(this + ".preferenceChanged('" + key + "', '"
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 5689)
+++ applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapPreferences.java	(revision 5689)
@@ -0,0 +1,32 @@
+package org.openstreetmap.josm.plugins.slippymap;
+
+import org.openstreetmap.josm.Main;
+
+/**
+ * Preferences for Slippy Map Tiles
+ * 
+ * @author Hakan Tandogan <hakan@gurkensalat.com>
+ * 
+ */
+public class SlippyMapPreferences
+{
+    public static String PREFERENCE_PREFIX   = "slippymap";
+
+    public static String PREFERENCE_TILE_URL = PREFERENCE_PREFIX + ".tile_url";
+
+    public static String getMapUrl()
+    {
+        String url = Main.pref.get(PREFERENCE_TILE_URL);
+
+        if (url == null || "".equals(url))
+        {
+            url = "http://tah.openstreetmap.org/Tiles/tile"; // t@h
+            // url = "http://tile.openstreetmap.org"; // mapnik 
+            // url = "http://hypercube.telascience.org/tiles/1.0.0/coastline" //
+            Main.pref.put(PREFERENCE_TILE_URL, url);
+            Main.pref.save();
+        }
+
+        return url;
+    }
+}
Index: applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapTile.java
===================================================================
--- applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapTile.java	(revision 5685)
+++ applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapTile.java	(revision 5689)
@@ -41,7 +41,8 @@
         try
         {
-            tileImage = Toolkit.getDefaultToolkit().createImage(
-                    new URL("http://tah.openstreetmap.org/Tiles/tile/" + z
-                            + "/" + x + "/" + y + ".png"));
+            URL imageURL = new URL(SlippyMapPreferences.getMapUrl() + "/" + z
+                    + "/" + x + "/" + y + ".png");
+
+            tileImage = Toolkit.getDefaultToolkit().createImage(imageURL);
         }
         catch (MalformedURLException mfu)
