--- SlippyMapPreferences.java.orig	2010-01-02 18:42:39.000000000 +1000
+++ SlippyMapPreferences.java	2010-01-02 19:42:46.000000000 +1000
@@ -286,13 +286,32 @@
             super(name, url);
             this.extension = extension;
         }
+        public Custom(String name, String url, String extension, String type) {
+            super(name, url);
+            this.extension = extension;
+            this.type = type;
+        }
+
         String extension;
+        String type;
+
         @Override
         public String getExtension() {
             if (extension == null)
                 return super.getExtension();
             return extension;
         }
+        public String getTilePath(int zoom, int tilex, int tiley) {
+            String ret;
+
+            if(!type.equals("URL"))
+                ret = "/"+zoom+"/"+tilex+"/"+tiley+"."+extension;
+            else
+                ret = "&z=" + zoom + "&x=" + tilex + "&y=" + tiley;
+
+            System.out.println("ret = "+ret);
+            return ret;
+        }
         public TileUpdate getTileUpdate() {
             return TileUpdate.IfNoneMatch;
         }
@@ -307,17 +326,20 @@
             // slippymap.custom_tile_source_1.name=OOC layer
             // slippymap.custom_tile_source_1.url=http://a.ooc.openstreetmap.org/npe
             // slippymap.custom_tile_source_1.ext=png
+            // slippymap.custom_tile_source_1.type=[URL|image]
 
             if (!(short_key.endsWith("name")))
                 continue;
             String url_key = short_key.replaceFirst("name","url");
             String ext_key = short_key.replaceFirst("name","ext");
+            String type_key = short_key.replaceFirst("name","type");
             String name = customSources.get(key);
             String url = customSources.get(PREFERENCE_TILE_CUSTOM_SOURCE + url_key);
             String ext = customSources.get(PREFERENCE_TILE_CUSTOM_SOURCE + ext_key);
+            String type = customSources.get(PREFERENCE_TILE_CUSTOM_SOURCE + type_key);
             // ext may be null, but that's OK
-            System.out.println("found new tile source: '" +name+"' url:'"+url+"'"+"' ext:'"+ext+"'");
-            ret.add(new Custom(name, url, ext));
+            System.out.println("found new tile source: '" +name+"' url:'"+url+"' ext:'"+ext+"' type:'"+type+"'");
+            ret.add(new Custom(name, url, ext, type));
         }
         return ret;
     }
