better still...
[potlatch2.git] / net / systemeD / halcyon / styleparser / Rule.as
index 061d1dd7536e3ee518e3d0e97930038336f1e4a7..cb54ed51f69c8a7a664795d7d048f5bf7bf15310 100644 (file)
@@ -6,18 +6,19 @@ package net.systemeD.halcyon.styleparser {
 
                public var conditions:Array = [];
                public var isAnd:Boolean = true;
-               public var minZoom:uint = 13;
-               public var maxZoom:uint = 19;
+               public var minZoom:uint = 13;                   // ** FIXME: shouldn't be hardcoded
+               public var maxZoom:uint = 19;                   //  |
                public var subject:String='';                   // "", "way", "node" or "relation"
                
                public function Rule(s:String=''):void {
                        subject=s;
                }
                
-               public function test(obj:Entity,tags:Object):Boolean {
+               public function test(obj:Entity,tags:Object,zoom:uint):Boolean {
                        if (subject!='' && obj.getType()!=subject) { return false; }
+                       if (zoom<minZoom || zoom>maxZoom) { return false; }
                        
-                       var v:Boolean; var i:uint=0;
+                       var v:Boolean=true; var i:uint=0;
                        for each (var condition:Condition in conditions) {
                                var r:Boolean=condition.test(tags);
                                if (i==0) { v=r; }