placeholders for second half of the code (will need a small API update before this...
authorRichard Fairhurst <richard@systemed.net>
Tue, 7 Dec 2010 15:29:19 +0000 (15:29 +0000)
committerRichard Fairhurst <richard@systemed.net>
Tue, 7 Dec 2010 15:29:19 +0000 (15:29 +0000)
net/systemeD/halcyon/connection/Entity.as
net/systemeD/halcyon/connection/XMLBaseConnection.as
net/systemeD/halcyon/connection/XMLConnection.as

index c365930..3a1491e 100644 (file)
@@ -16,6 +16,7 @@ package net.systemeD.halcyon.connection {
                private var parents:Dictionary = new Dictionary();
                public var locked:Boolean = false;                                              // lock against purging when off-screen
                public var deleted:Boolean = false;
+//             public var parentsLoaded:Boolean = true;                                // are all its parents in memory?
 
         public function Entity(id:Number, version:uint, tags:Object, loaded:Boolean, uid:Number, timestamp:String) {
             this._id = id;
index e304384..16cbeb2 100644 (file)
@@ -30,6 +30,11 @@ package net.systemeD.halcyon.connection {
             var node:Node, newNode:Node;
             var unusedNodes:Object={};
 
+                       var minlon:Number=map.bounds.@minlon;
+                       var maxlon:Number=map.bounds.@maxlon;
+                       var minlat:Number=map.bounds.@minlat;
+                       var maxlat:Number=map.bounds.@maxlat;
+
             for each(var relData:XML in map.relation) {
                 id = Number(relData.@id);
                 version = uint(relData.@version);
@@ -93,9 +98,12 @@ package net.systemeD.halcyon.connection {
                                                   nodeData.@timestamp);
                                
                                if ( node == null || !node.loaded) {
+//                                     newNode.parentsLoaded=newNode.within(minlon,maxlon,minlat,maxlat);
+//                                     ** updateEntityProperties will need to do parentsLoaded as well
                                        setOrUpdateNode(newNode, true);
                                } else {
                                        // the node's already in memory, but store it in case one of the new ways needs it
+//                                     if (newNode.within(minlon,maxlon,minlat,maxlat)) newNode.parentsLoaded=true;
                                        unusedNodes[id]=newNode;
                                }
                        }
index c4e48db..f3f44dd 100644 (file)
@@ -265,6 +265,7 @@ package net.systemeD.halcyon.connection {
                     continue;
                     
                 var xml:XML = serialise(entity);
+                // ** if parentsLoaded==false, do a soft delete only
                 xml.@changeset = changeset.id;
                 del.appendChild(xml);
             }