Index: /applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java
===================================================================
--- /applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java	(revision 3590)
+++ /applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java	(revision 3591)
@@ -15,15 +15,15 @@
 public class ElemStyleHandler extends DefaultHandler
 {
-    boolean inDoc, inRule, inCondition, inElemStyle, inLine, inIcon, inArea;
-    ElemStyle curLineStyle=null;
-    ElemStyle curIconStyle=null;
-    ElemStyle curAreaStyle=null;
-    ElemStyles styles;
-    String curKey, curValue ;
-		int curWidth = 1, curRealWidth = 0;
-	int curMinZoom;
-    ImageIcon curIcon;
-    Color curColour;
-    boolean curAnnotate;
+    boolean inDoc, inRule, inCondition, inElemStyle, inLine, inIcon, inArea, inScaleMax;
+    ElemStyles styles = null;
+    String curKey = null;
+	String curValue = null;
+	int curLineWidth = 1;
+	int curLineRealWidth = 0;
+    Color curLineColour = null;
+    Color curAreaColour = null;
+    ImageIcon curIcon = null;
+    boolean curIconAnnotate = true;
+	int curScaleMax = 1000000000;
 
     public ElemStyleHandler(  )
@@ -81,20 +81,15 @@
                 {
                     if(atts.getQName(count).equals("width"))
-                        curWidth = Integer.parseInt(atts.getValue(count));
+                        curLineWidth = Integer.parseInt(atts.getValue(count));
                     else if (atts.getQName(count).equals("colour"))
-                        curColour=ColorHelper.html2color(atts.getValue(count));
+                        curLineColour=ColorHelper.html2color(atts.getValue(count));
 										else if (atts.getQName(count).equals("realwidth"))
-												curRealWidth=Integer.parseInt(atts.getValue(count));
+												curLineRealWidth=Integer.parseInt(atts.getValue(count));
                 }
             }
-			else if (qName.equals("zoom"))
+			else if (qName.equals("scale_max"))
 			{
-				curMinZoom = 0;
-                for(int count=0; count<atts.getLength(); count++)
-                {
-                    if(atts.getQName(count).equals("min"))
-                        curMinZoom = Integer.parseInt(atts.getValue(count));
-                }
-			}	
+				inScaleMax = true;
+			}
             else if (qName.equals("icon"))
             {
@@ -120,5 +115,5 @@
 												}
                     } else if (atts.getQName(count).equals("annotate"))
-                        curAnnotate = Boolean.parseBoolean
+                        curIconAnnotate = Boolean.parseBoolean
                                         (atts.getValue(count));
                 }
@@ -130,5 +125,5 @@
                 {
                     if (atts.getQName(count).equals("colour"))
-                        curColour=ColorHelper.html2color(atts.getValue(count));
+                        curAreaColour=ColorHelper.html2color(atts.getValue(count));
                 }
             }
@@ -136,51 +131,56 @@
     }
 
-
     @Override public void endElement(String uri,String name, String qName)
     {
         if(inRule && qName.equals("rule"))
         {
+			ElemStyle newStyle;
             inRule = false;
-			if(curLineStyle != null)
+			if(curLineWidth != -1)
 			{
-            	styles.add (curKey, curValue, curLineStyle);
-				curLineStyle = null;
+            	newStyle = new LineElemStyle(curLineWidth, curLineRealWidth, curLineColour,
+										curScaleMax);
+            	styles.add (curKey, curValue, newStyle);
+				curLineWidth	= 1;
+				curLineRealWidth= 0;
+				curLineColour 	= null;
 			}
-			if(curIconStyle != null)
+			if(curIcon != null)
 			{
-            	styles.add (curKey, curValue, curIconStyle);
-				curIconStyle = null;
+				newStyle = new IconElemStyle(curIcon,curIconAnnotate,curScaleMax);
+            	styles.add (curKey, curValue, newStyle);
+				curIcon 		= null;
+				curIconAnnotate = true;
 			}
-			if(curAreaStyle != null)
+			if(curAreaColour != null)
 			{
-            	styles.add (curKey, curValue, curAreaStyle);
-				curAreaStyle = null;
+            	newStyle = new AreaElemStyle (curAreaColour,curScaleMax);
+            	styles.add (curKey, curValue, newStyle);
+				curAreaColour 	= null;
 			}
+			curScaleMax = 1000000000;
+
         }
         else if (inCondition && qName.equals("condition"))
             inCondition = false;
         else if (inLine && qName.equals("line"))
-        {
             inLine = false;
-            curLineStyle = new LineElemStyle(curWidth,curRealWidth, curColour,
-										curMinZoom);
-						curWidth=1;
-						curRealWidth = 0;
-        }
         else if (inIcon && qName.equals("icon"))
-        {
             inIcon = false;
-            curIconStyle = new IconElemStyle(curIcon,curAnnotate,curMinZoom);
-        }
         else if (inArea && qName.equals("area"))
-        {
             inArea = false;
-            curAreaStyle = new AreaElemStyle (curColour,curMinZoom);
-        }
-
+		else if (qName.equals("scale_max"))
+			{
+				inScaleMax = false;
+			}
     }
 
     @Override public void characters(char ch[], int start, int length)
     {
+		if(	inScaleMax == true) {
+			String content = new String(ch, start, length);
+
+			curScaleMax = Integer.parseInt(content);
+		}
     }
 }
Index: /applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java
===================================================================
--- /applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java	(revision 3590)
+++ /applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java	(revision 3591)
@@ -30,4 +30,28 @@
 public class MapPaintVisitor extends SimplePaintVisitor {
 
+	protected boolean isZoomOk(ElemStyle e) {
+		double circum = Main.map.mapView.getScale()*100*Main.proj.scaleFactor()*40041455; // circumference of the earth in meter
+		
+		/* show everything, if the user wishes so */
+		if(!Main.pref.getBoolean("mappaint.zoomLevelDisplay",false)) {
+			return true;
+		}
+			
+		if(e == null) {
+			/* the default for things that don't have a rule (show, if scale is smaller than 1500m) */
+			if(circum < 1500) {
+				return true;
+			} else {
+				return false;
+			}
+		}
+		
+		if(circum>=e.getMinZoom() / 70) {
+			return false;
+		} else {
+			return true;
+		}
+	}
+	
 	/**
 	 * Draw a small rectangle.
@@ -39,7 +63,9 @@
 	@Override public void visit(Node n) {
 		ElemStyle nodeStyle = MapPaintPlugin.elemStyles.getStyle(n);
-		if(nodeStyle!=null && Main.map.mapView.zoom()>=nodeStyle.getMinZoom()){
+		if(nodeStyle!=null){
 			if(nodeStyle instanceof IconElemStyle) {
-				drawNode(n, ((IconElemStyle)nodeStyle).getIcon());
+				if(isZoomOk(nodeStyle)) {
+					drawNode(n, ((IconElemStyle)nodeStyle).getIcon());
+				}
 			} else {
 				// throw some sort of exception
@@ -58,5 +84,8 @@
 	 */
 	@Override public void visit(Segment ls) {
+		ElemStyle segmentStyle = MapPaintPlugin.elemStyles.getStyle(ls);
+		if(isZoomOk(segmentStyle)) {
 			drawSegment(ls, getPreferencesColor("untagged",Color.GRAY),Main.pref.getBoolean("draw.segment.direction"));
+		}
 	}
 
@@ -75,4 +104,9 @@
 		boolean area=false;
 		ElemStyle wayStyle = MapPaintPlugin.elemStyles.getStyle(w);
+		
+		if(!isZoomOk(wayStyle)) {
+			return;
+		}
+		
 		if(wayStyle!=null)
 		{
@@ -188,5 +222,5 @@
 		Point p1 = nc.getPoint(ls.from.eastNorth);
 		Point p2 = nc.getPoint(ls.to.eastNorth);
-
+		
 		// checking if this segment is visible
 		if ((p1.x < 0) && (p2.x < 0)) return ;
@@ -223,8 +257,10 @@
 	 */
 	@Override public void drawNode(Node n, Color color) {
-		Point p = nc.getPoint(n.eastNorth);
-		if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return;
-		g.setColor(color);
-		g.drawRect(p.x-1, p.y-1, 2, 2);
+		if(isZoomOk(null)) {
+			Point p = nc.getPoint(n.eastNorth);
+			if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return;
+			g.setColor(color);
+			g.drawRect(p.x-1, p.y-1, 2, 2);
+		}
 	}
 
