add 'line' and 'area' MapCSS objects
authorRichard Fairhurst <richard@systemed.net>
Sat, 29 Jan 2011 18:20:57 +0000 (18:20 +0000)
committerRichard Fairhurst <richard@systemed.net>
Sat, 29 Jan 2011 18:20:57 +0000 (18:20 +0000)
net/systemeD/halcyon/connection/Entity.as
net/systemeD/halcyon/connection/Way.as
net/systemeD/halcyon/styleparser/Rule.as

index 4c3f70e2cab76d43ca7267ea8623581b672f16dd..cd67a9d58c882464abc8cfbb7f64ebfe7db3804b 100644 (file)
@@ -390,6 +390,11 @@ package net.systemeD.halcyon.connection {
             return '';
         }
 
+               /** Compare type against supplied string */
+               public function isType(str:String):String {
+                       return getType()==str;
+               }
+
     }
 
 }
index 72fcc475080f50ac763a11e4135025cb572fcfea..6c9ae57b071d4d63db12ecf2ddb9cdcc95487228 100644 (file)
@@ -258,6 +258,13 @@ package net.systemeD.halcyon.connection {
                public override function getType():String {
                        return 'way';
                }
+               
+               public override function isType(str:String):String {
+                       if (str=='way') return true;
+                       if (str=='line' && !isArea()) return true;
+                       if (str=='area' &&  isArea()) return true;
+                       return false;
+               }
     }
 
 }
index ac6a0bb62c44862fff006af35616a31cd5e0e322..08da544f7cc65ed2dc25ae1dddcce04deef665ac 100644 (file)
@@ -8,14 +8,14 @@ package net.systemeD.halcyon.styleparser {
                public var isAnd:Boolean = true;
                public var minZoom:uint = 0;
                public var maxZoom:uint = 255;
-               public var subject:String='';                   // "", "way", "node" or "relation"
+               public var subject:String='';                   // "", "way", "area", "line", "node" or "relation"
                
                public function Rule(s:String=''):void {
                        subject=s;
                }
                
                public function test(obj:Entity,tags:Object,zoom:uint):Boolean {
-                       if (subject!='' && obj.getType()!=subject) { return false; }
+                       if (subject!='' && !obj.isType(subject)) { return false; }
                        if (zoom<minZoom || zoom>maxZoom) { return false; }
                        
                        var v:Boolean=true; var i:uint=0;