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 18804)
+++ applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapPreferenceSetting.java	(revision 18805)
@@ -11,4 +11,6 @@
 import javax.swing.JSpinner;
 import javax.swing.SpinnerNumberModel;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
 import java.util.Collection;
 
@@ -75,7 +77,34 @@
         slippymapTab.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
 
+        tileSourceCombo.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                //Main.debug("updating spinner models because of tileSourceCombo");
+                updateSpinnerModels();
+            }
+        });
+
         this.loadSettings();
+        updateSpinnerModels();
     }
 
+
+    void updateSpinnerModel(JSpinner s, int min, int max)
+    {
+        int val = (Integer)s.getValue();
+        //Main.debug("updating spinner model val: " + val + " " + min + "->" + max);
+        val = Math.min(max, val);
+        val = Math.max(min, val);
+        SpinnerNumberModel model = new SpinnerNumberModel(val, min, max, 1);
+        s.setModel(model);
+    }
+
+    void updateSpinnerModels()
+    {
+        TileSource ts = (TileSource)this.tileSourceCombo.getSelectedItem();
+        int min = ts.getMinZoom();
+        int max = ts.getMaxZoom();
+        updateSpinnerModel(minZoomLvl, min, max);
+        updateSpinnerModel(maxZoomLvl, min, max);
+    }
 
     /**
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 18804)
+++ applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapPreferences.java	(revision 18805)
@@ -38,4 +38,8 @@
     {
         String name = Main.pref.get(PREFERENCE_TILE_SOURCE);
+        return getMapSource(name);
+    }
+    public static TileSource getMapSource(String name)
+    {
         List<TileSource> sources = SlippyMapPreferences.getAllMapSources();
         TileSource source = sources.get(0);
@@ -185,4 +189,9 @@
     		maxZoomLvl = SlippyMapPreferences.__getMinZoomLvl();
     	}
+        TileSource ts = getMapSource();
+        if (ts != null && ts.getMaxZoom() < SlippyMapPreferences.__getMinZoomLvl()) {
+    		System.err.println("decreasing maxZoomLvl to match new tile source");
+            maxZoomLvl = ts.getMaxZoom();
+        }
         return maxZoomLvl;
     }
