When downloading from the Connection, also download from the VectorLayers
authorAndy Allan <gravitystorm@gmail.com>
Mon, 22 Nov 2010 19:15:20 +0000 (19:15 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Mon, 22 Nov 2010 19:15:20 +0000 (19:15 +0000)
net/systemeD/halcyon/Map.as
net/systemeD/halcyon/VectorLayer.as

index 2df61ef..748d12c 100644 (file)
@@ -220,10 +220,9 @@ package net.systemeD.halcyon {
             }
                }
 
-               // ------------------------------------------------------------------------------------------
-               // Download map data
-               // (typically from whichways, but will want to add more connections)
-
+        /** Download map data. Data is downloaded for the connection and the vector layers, where supported.
+        * The bounding box for the download is taken from the current map edges.
+        */
                public function download():void {
                        this.dispatchEvent(new MapEvent(MapEvent.DOWNLOAD, {minlon:edge_l, maxlon:edge_r, maxlat:edge_t, minlat:edge_b} ));
                        
@@ -236,6 +235,11 @@ package net.systemeD.halcyon {
                        }
                        addDebug("Calling download with "+edge_l+"-"+edge_r+", "+edge_t+"-"+edge_b);
                        connection.loadBbox(edge_l,edge_r,edge_t,edge_b);
+
+            // Do the same for vector layers
+            for each (var layer:VectorLayer in vectorlayers) {
+              layer.loadBbox(edge_l,edge_r,edge_t,edge_b);
+            }
                }
 
         private function newWayCreated(event:EntityEvent):void {
index 7b4a8dc..5ab6db9 100644 (file)
@@ -174,5 +174,13 @@ package net.systemeD.halcyon {
                        relations={}; nodes={}; ways={}; pois=[];
                }
 
+        /**
+        * Load more data, eg during panning of the map. This can be overridden by
+        * vector layers if it makes sense to support it.
+        */
+        public function loadBbox(left:Number, right:Number,
+                                top:Number, bottom:Number):void {
+        }
+
        }
 }