First bash at duplicate node highlighting. Needs a rethink to cope with nodes being...
authorAndy Allan <gravitystorm@gmail.com>
Fri, 5 Nov 2010 11:35:34 +0000 (11:35 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Fri, 5 Nov 2010 11:35:34 +0000 (11:35 +0000)
net/systemeD/halcyon/NodeUI.as
net/systemeD/halcyon/connection/Connection.as
net/systemeD/halcyon/connection/Node.as
resources/potlatch.css

index 3b05fbc..5ea002a 100644 (file)
@@ -51,6 +51,7 @@ package net.systemeD.halcyon {
                        tags=applyStateClasses(tags);
                        if (!entity.hasParentWays) { tags[':poi']='yes'; }
             if (entity.hasInterestingTags()) { tags[':hasTags']='yes'; }
+            if (Node(entity).isDupe()) { tags[':dupe']='yes'; }
                        if (!styleList || !styleList.isValidAt(paint.map.scale)) {
                                styleList=paint.ruleset.getStyles(entity,tags,paint.map.scale); 
                        }
index a06b9d6..0808a89 100755 (executable)
@@ -97,6 +97,7 @@ package net.systemeD.halcyon.connection {
                public var waycount:int=0;
                public var relationcount:int=0;
         private var traces:Array = [];
+        public var nodePositions:Object = {};
         protected var traces_loaded:Boolean = false;
 
         protected function get nextNegative():Number {
@@ -106,6 +107,11 @@ package net.systemeD.halcyon.connection {
         protected function setNode(node:Node, queue:Boolean):void {
                        if (!nodes[node.id]) { nodecount++; }
             nodes[node.id] = node;
+            var a:String = node.lat+","+node.lon
+            if(!nodePositions[a]) {
+              nodePositions[a] = [];
+            }
+            nodePositions[a].push(node.id);
             if (node.loaded) { sendEvent(new EntityEvent(NEW_NODE, node),queue); }
         }
 
index 54117d6..498e46c 100644 (file)
@@ -79,7 +79,16 @@ package net.systemeD.halcyon.connection {
               trace("not enough ways");
             }
         }
-               
+
+        public function isDupe():Boolean {
+            // need to rethink this, since nodes can be on different layers
+            var connection:Connection = Connection.getConnection();
+            if (connection.nodePositions[lat+","+lon] && connection.nodePositions[lat+","+lon].length > 1) {
+              return true;
+            }
+            return false;
+        }
+
                internal override function isEmpty():Boolean {
                        return deleted;
                }
index 082c78b..3d3d9a2 100644 (file)
@@ -262,7 +262,7 @@ way :tiger { casing-color: #ff00ff;}
 
 relation[type=restriction] node { z-index:11; icon-image: icons/restriction.png; }
 
-
+node :dupe { z-index: 9; icon-image: circle; icon-width:8; color: white; opacity: 0.4; casing-opacity: 0.4; casing-color: red; casing-width: 3; }
 node :hoverway { z-index: 9; icon-image: square; icon-width: 7; color: blue; }
 node !:drawn :poi { z-index: 2; icon-image: circle; icon-width: 4; color: green; casing-color: black; casing-width: 1; }
 node !:drawn :hasTags { z-index: 9; icon-image: circle; icon-width: 4; color: black; }