fix problem with nodes not being deselected
authorRichard Fairhurst <richard@systemed.net>
Sat, 28 Nov 2009 13:41:51 +0000 (13:41 +0000)
committerRichard Fairhurst <richard@systemed.net>
Sat, 28 Nov 2009 13:41:51 +0000 (13:41 +0000)
net/systemeD/halcyon/Map.as
net/systemeD/halcyon/WayUI.as

index 5cec07e8831e5dd96979ed39dc0da57647b7e81a..7941bbe96aba190a5a1b845e9e481bf4953fd67f 100755 (executable)
@@ -16,6 +16,7 @@ package net.systemeD.halcyon {
     import net.systemeD.halcyon.connection.*;
     import net.systemeD.halcyon.connection.EntityEvent;
        import net.systemeD.halcyon.styleparser.*;
+       import net.systemeD.halcyon.Globals;
 
 //     for experimental export function:
 //     import flash.net.FileReference;
@@ -285,6 +286,11 @@ package net.systemeD.halcyon {
 
         public function setHighlight(entity:Entity, settings:Object):void {
                        var stateType:String;
+var s:String="";
+for (stateType in settings) {
+       s+=stateType+"="+settings[stateType]+" ";
+}
+Globals.vars.root.addDebug("       setHighlight ("+s+"): "+entity);
             if ( entity is Way ) {
                 var wayUI:WayUI = ways[entity.id];
                 if (wayUI==null) { return; }
index 5cea2a34ff0961943072a6563f053a7645912660..6933fd443525907c0103bab17b57cbf725e73a65 100755 (executable)
@@ -118,7 +118,7 @@ package net.systemeD.halcyon {
             // Copy tags object, and add states
             var tags:Object = way.getTagsCopy();
             for (var stateKey:String in stateClasses) {
-                tags[":"+stateKey] = stateKey;
+                tags[":"+stateKey] = 'yes';
             }
                        if (way.isArea()) { tags[':area']='yes'; }
 
@@ -202,7 +202,7 @@ package net.systemeD.halcyon {
                                if (highlight) { nodetags[':selectedway']='yes'; }
                                sl=map.ruleset.getStyles(node,nodetags);
                                if (sl.hasStyles()) {
-                                       map.pois[node.id]=new NodeUI(node,map,r);
+                                       if (!map.pois[node.id]) { map.pois[node.id]=new NodeUI(node,map,r); }
                                        map.pois[node.id].redraw(sl);
                                        // ** this should be done via the registerPOI/event listener mechanism,
                                        //    but that needs a bit of reworking so we can pass in a styleList