Index: /applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/CanVecTile.java
===================================================================
--- /applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/CanVecTile.java	(revision 27925)
+++ /applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/CanVecTile.java	(revision 27926)
@@ -152,6 +152,6 @@
 		else this.tileid = String.format("%03d%s%02d%s",corda,cordb,cordc,cordd);
 		valid = true;
-		debug(index.toString());
-		debug("creating tileid: "+this.tileid);
+		//debug(index.toString());
+		//debug("creating tileid: "+this.tileid);
 	}
 	public boolean isValid() { return valid; }
@@ -257,9 +257,7 @@
 			break;
 		case 2:
-			debug("making layer2 tiles, index: "+index.toString());
 			p = Pattern.compile("\\d\\d\\d[A-Z](\\d\\d).*");
 			int last_cell2 = -1;
 			for (int i = 0; i < index.size(); i++) {
-				debug(index.get(i));
 				Matcher m = p.matcher(index.get(i));
 				m.matches();
@@ -271,6 +269,4 @@
 					buffer.add(m.group(0));
 				} else {
-					debug(buffer.toString());
-					debug(""+last_cell2);
 					sub_tiles.add(new CanVecTile(corda,cordb,last_cell2,"",plugin_self,buffer));
 					buffer = new ArrayList<String>();
@@ -284,10 +280,9 @@
 		sub_tiles_made = true;
 	}
-	public void paint(Graphics2D g, MapView mv, Bounds bounds) {
+	public void paint(Graphics2D g, MapView mv, Bounds bounds, int max_zoom) {
 		boolean show_sub_tiles = false;
 		if (!isVisible(bounds)) return;
 		if ((depth == 3) && (bounds.getArea() < 0.5)) { // 022B01
-			downloadSelf();
-			debug(sub_tile_ids.toString());
+			if (max_zoom == 4) downloadSelf();
 			show_sub_tiles = true;
 		} else if ((depth == 2) && (bounds.getArea() < 20)) { // its a layer2 tile
@@ -298,4 +293,10 @@
 			make_sub_tiles(1);
 			show_sub_tiles = true;
+		}
+		if (show_sub_tiles && (depth < max_zoom)) {
+			for (int i = 0; i < sub_tiles.size(); i++) {
+				CanVecTile tile = sub_tiles.get(i);
+				tile.paint(g,mv,bounds,max_zoom);
+			}
 		} else {
 			Point corners[] = getCorners(mv);
@@ -306,10 +307,4 @@
 			g.drawString(getTileId(),corners[0].x,corners[0].y);
 		}
-		if (show_sub_tiles) {
-			for (int i = 0; i < sub_tiles.size(); i++) {
-				CanVecTile tile = sub_tiles.get(i);
-				tile.paint(g,mv,bounds);
-			}
-		}
 	}
 }
Index: /applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/CanvecHelperAction.java
===================================================================
--- /applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/CanvecHelperAction.java	(revision 27925)
+++ /applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/CanvecHelperAction.java	(revision 27926)
@@ -2,5 +2,4 @@
 
 import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.plugins.Plugin;
 import org.openstreetmap.josm.Main;
 
Index: /applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/canvec_helper.java
===================================================================
--- /applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/canvec_helper.java	(revision 27925)
+++ /applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/canvec_helper.java	(revision 27926)
@@ -13,5 +13,4 @@
 	}
 	public void mapFrameInitialized(MapFrame old, MapFrame new1) {
-		System.out.println("mapFrame made!");
 		updateLayer();
 	}
Index: /applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/canvec_layer.java
===================================================================
--- /applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/canvec_layer.java	(revision 27925)
+++ /applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/canvec_layer.java	(revision 27926)
@@ -3,5 +3,7 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 import org.openstreetmap.josm.gui.layer.Layer;
+import java.awt.Component;
 import java.awt.Graphics2D;
+import java.awt.event.ActionEvent;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
@@ -13,7 +15,10 @@
 import java.io.IOException;
 
+import javax.swing.AbstractAction;
 import javax.swing.Action;
 import javax.swing.Icon;
 import javax.swing.ImageIcon;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
 import org.openstreetmap.josm.actions.RenameLayerAction;
 import org.openstreetmap.josm.data.Bounds;
@@ -27,8 +32,10 @@
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
+import java.util.List;
 
 // most of the layout was copied from the openstreetbugs plugin to get things started
 public class canvec_layer extends Layer implements MouseListener {
 	private Icon layerIcon = null;
+	private int max_zoom = 3;
 	canvec_helper plugin_self;
 	private ArrayList<CanVecTile> tiles = new ArrayList<CanVecTile>();
@@ -80,5 +87,27 @@
 			LayerListDialog.getInstance().createDeleteLayerAction(),
 			SeparatorLayerAction.INSTANCE,
-			new LayerListPopup.InfoAction(this)};
+			new LayerListPopup.InfoAction(this),
+			new MaxZoomAction(this)};
+	}
+	public class MaxZoomAction extends AbstractAction implements LayerAction {
+		private canvec_layer parent;
+		public MaxZoomAction(canvec_layer parent) {
+			this.parent = parent;
+		}
+		public void actionPerformed(ActionEvent e) {}
+		public boolean supportLayers(List<Layer> layers) {
+			return false;
+		}
+		public Component createMenuComponent() {
+			JMenu max_zoom = new JMenu("max zoom");
+			max_zoom.add(new JMenuItem(new SetMaxZoom(parent,1)));
+			max_zoom.add(new JMenuItem(new SetMaxZoom(parent,2)));
+			max_zoom.add(new JMenuItem(new SetMaxZoom(parent,3)));
+			max_zoom.add(new JMenuItem(new SetMaxZoom(parent,4)));
+			return max_zoom;
+		}
+	}
+	public void setMaxZoom(int max_zoom) {
+		this.max_zoom = max_zoom;
 	}
 	public Object getInfoComponent() {
@@ -101,5 +130,5 @@
 		for (int i = 0; i < tiles.size(); i++) {
 			CanVecTile tile = tiles.get(i);
-			tile.paint(g,mv,bounds);
+			tile.paint(g,mv,bounds,max_zoom);
 		}
 		long end = System.currentTimeMillis();
