Make the nodePositions array private
authorAndy Allan <gravitystorm@gmail.com>
Mon, 8 Nov 2010 18:07:02 +0000 (18:07 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Mon, 8 Nov 2010 18:07:02 +0000 (18:07 +0000)
net/systemeD/halcyon/connection/Connection.as
net/systemeD/halcyon/connection/Node.as

index 44385296855b60b35799a8a8ff437afd69fedb8b..04b7ba102028372a3177b86778b7404c4c559c9b 100755 (executable)
@@ -97,7 +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 = {};
+        private var nodePositions:Object = {};
         protected var traces_loaded:Boolean = false;
 
         protected function get nextNegative():Number {
@@ -388,6 +388,13 @@ package net.systemeD.halcyon.connection {
             nodePositions[a] = dupes;
         }
 
+        public function nodesAtPosition(lat:Number, lon:Number):uint {
+            if (nodePositions[lat+","+lon]) {
+              return nodePositions[lat+","+lon].length;
+            }
+            return 0;
+        }
+
         // these are functions that the Connection implementation is expected to
         // provide. This class has some generic helpers for the implementation.
                public function loadBbox(left:Number, right:Number,
index 6328b159ac415b4988a9d275945d90d7d94a4ff3..b7054823c11947bc3382f07763076fb31261cce1 100644 (file)
@@ -87,7 +87,7 @@ package net.systemeD.halcyon.connection {
         public function isDupe():Boolean {
             var connection:Connection = Connection.getConnection();
             if (connection.getNode(this.id) == this // node could be part of a vector layer
-                && connection.nodePositions[lat+","+lon] && connection.nodePositions[lat+","+lon].length > 1) {
+                && connection.nodesAtPosition(lat, lon) > 1) {
               return true;
             }
             return false;