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 3b05fbcd57e812651cbbe9ba8d45a0d0e9aa73ef..5ea002a0df32025b071f7d607ef652114e15ef9d 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 a06b9d6e4b76dc373f11c8493453bebca3ae56c9..0808a89ea812c5a3ccb9ac26e0ec8fd1d72d5259 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 54117d6f6a89f326c1290b4e3704b36492bf29bf..498e46c10a1ea3384b5a40ba72b7be1bf3d13ec2 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 082c78b4d5f171425254a8b9abc48f0147d11907..3d3d9a2726ae8a4a1ccc51351d101c02f422df1b 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; }