From f48d2335db431f06b6dcae7c26eff75acc8e73d4 Mon Sep 17 00:00:00 2001 From: Richard Fairhurst Date: Sat, 28 Nov 2009 13:41:51 +0000 Subject: [PATCH] fix problem with nodes not being deselected --- net/systemeD/halcyon/Map.as | 6 ++++++ net/systemeD/halcyon/WayUI.as | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/net/systemeD/halcyon/Map.as b/net/systemeD/halcyon/Map.as index 5cec07e8..7941bbe9 100755 --- a/net/systemeD/halcyon/Map.as +++ b/net/systemeD/halcyon/Map.as @@ -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; } diff --git a/net/systemeD/halcyon/WayUI.as b/net/systemeD/halcyon/WayUI.as index 5cea2a34..6933fd44 100755 --- a/net/systemeD/halcyon/WayUI.as +++ b/net/systemeD/halcyon/WayUI.as @@ -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 -- 2.36.1