this should speed up redraw - need to add registerPOI support for vector background...
authorRichard Fairhurst <richard@systemed.net>
Sun, 7 Nov 2010 17:27:49 +0000 (17:27 +0000)
committerRichard Fairhurst <richard@systemed.net>
Sun, 7 Nov 2010 17:27:49 +0000 (17:27 +0000)
net/systemeD/halcyon/MapPaint.as
net/systemeD/halcyon/VectorLayer.as
net/systemeD/halcyon/connection/Connection.as

index 79d7815..b2e3697 100644 (file)
@@ -112,7 +112,7 @@ package net.systemeD.halcyon {
                }
 
                public function updateEntityUIs(o:Object, redraw:Boolean, remove:Boolean):void {
-                       var way:Way, node:Node;
+                       var way:Way, poi:Node;
 
                        for each (way in o.waysInside) {
                                if (!wayuis[way.id]) { createWayUI(way); }
@@ -129,17 +129,17 @@ package net.systemeD.halcyon {
                                }
                        }
 
-                       for each (node in o.nodesInside) {
-                               if (!nodeuis[node.id]) { createNodeUI(node); }
-                               else if (redraw) { nodeuis[node.id].redraw(); }
+                       for each (poi in o.poisInside) {
+                               if (!nodeuis[poi.id]) { createNodeUI(poi); }
+                               else if (redraw) { nodeuis[poi.id].redraw(); }
                        }
 
                        if (remove) {
-                               for each (node in o.nodesOutside) { 
-                                       if (nodeuis[node.id] && !nodeuis[node.id].purgable) {
-                                               if (redraw) { nodeuis[node.id].redraw(); }
+                               for each (poi in o.poisOutside) { 
+                                       if (nodeuis[poi.id] && !nodeuis[poi.id].purgable) {
+                                               if (redraw) { nodeuis[poi.id].redraw(); }
                                        } else {
-                                               deleteNodeUI(node);
+                                               deleteNodeUI(poi);
                                        }
                                }
                        }
index b4f6a5c..e97a1cf 100644 (file)
@@ -52,14 +52,15 @@ package net.systemeD.halcyon {
                public function getObjectsByBbox(left:Number, right:Number, top:Number, bottom:Number):Object {
                        // ** FIXME: this is just copied-and-pasted from Connection.as, which really isn't very
                        // good practice. Is there a more elegant way of doing it?
-                       var o:Object = { nodesInside: [], nodesOutside: [], waysInside: [], waysOutside: [] };
+                       var o:Object = { poisInside: [], poisOutside: [], waysInside: [], waysOutside: [] };
                        for each (var way:Way in ways) {
                                if (way.within(left,right,top,bottom)) { o.waysInside.push(way); }
                                                                  else { o.waysOutside.push(way); }
                        }
-                       for each (var node:Node in nodes) {
-                               if (node.within(left,right,top,bottom)) { o.nodesInside.push(node); }
-                                                                  else { o.nodesOutside.push(node); }
+                       // ** FIXME: this needs to do POIs, not nodes (i.e. we need registerPOI for vector layers too)
+                       for each (var poi:Node in nodes) {
+                               if (poi.within(left,right,top,bottom)) { o.poisInside.push(poi); }
+                                                                  else { o.poisOutside.push(poi); }
                        }
                        return o;
                }
index e4e2c6c..799985f 100755 (executable)
@@ -289,14 +289,14 @@ package net.systemeD.halcyon.connection {
         }
 
                public function getObjectsByBbox(left:Number, right:Number, top:Number, bottom:Number):Object {
-                       var o:Object = { nodesInside: [], nodesOutside: [], waysInside: [], waysOutside: [] };
+                       var o:Object = { poisInside: [], poisOutside: [], waysInside: [], waysOutside: [] };
                        for each (var way:Way in ways) {
                                if (way.within(left,right,top,bottom)) { o.waysInside.push(way); }
                                                                  else { o.waysOutside.push(way); }
                        }
-                       for each (var node:Node in nodes) {
-                               if (node.within(left,right,top,bottom)) { o.nodesInside.push(node); }
-                                                                  else { o.nodesOutside.push(node); }
+                       for each (var poi:Node in pois) {
+                               if (poi.within(left,right,top,bottom)) { o.poisInside.push(poi); }
+                                                                 else { o.poisOutside.push(poi); }
                        }
                        return o;
                }