select and move POI nodes, and a handful of smaller fixes too
[potlatch2.git] / net / systemeD / halcyon / WayUI.as
index 1c35f058c7fe9b647a9185ad4954ef8cbfa6424e..9cbfa6a776309d0c3f43c60601465294129a02dc 100755 (executable)
@@ -112,14 +112,12 @@ package net.systemeD.halcyon {
                // ------------------------------------------------------------------------------------------
                // Redraw
 
-               public function redraw():void {
+               override public function redraw(sl:StyleList=null):Boolean {
                        removeSprites();
 
             // Copy tags object, and add states
             var tags:Object = way.getTagsCopy();
-            for (var stateKey:String in stateClasses) {
-                tags[":"+stateKey] = 'yes';
-            }
+                       tags=applyStateClasses(tags);
                        if (way.isArea()) { tags[':area']='yes'; }
 
                        // Which layer?
@@ -128,7 +126,7 @@ package net.systemeD.halcyon {
                 layer=Math.min(Math.max(tags['layer']+5,-5),5)+5;
 
                        // Iterate through each sublayer, drawing any styles on that layer
-                       var sl:StyleList=map.ruleset.getStyles(this.way, tags);
+                       if (!sl) { sl=map.ruleset.getStyles(this.way, tags); }
                        var drawn:Boolean;
                        for (var sublayer:int=10; sublayer>=0; sublayer--) {
                                if (sl.shapeStyles[sublayer]) {
@@ -213,7 +211,7 @@ package net.systemeD.halcyon {
                                        map.pois[node.id].removeSprites();
                                }
                        }
-                       if (!drawn) { return; }
+                       if (!drawn) { return false; }
                        
             // create a generic "way" hitzone sprite
             hitzone = new Sprite();
@@ -223,6 +221,7 @@ package net.systemeD.halcyon {
             hitzone.visible = false;
                        createListenSprite(hitzone);
 
+                       return true;
                }
                
                // ------------------------------------------------------------------------------------------