Restore the concept of configured-but-not-loaded now that we can have non-visible...
authorAndy Allan <andy@gravitystorm.co.uk>
Wed, 6 Jul 2011 11:45:48 +0000 (12:45 +0100)
committerAndy Allan <andy@gravitystorm.co.uk>
Wed, 6 Jul 2011 11:45:48 +0000 (12:45 +0100)
net/systemeD/potlatch2/utils/BikeShopLoader.as
net/systemeD/potlatch2/utils/BugLoader.as
net/systemeD/potlatch2/utils/SnapshotLoader.as

index 87996f3..003e671 100644 (file)
@@ -34,12 +34,12 @@ package net.systemeD.potlatch2.utils {
             this.bikeShopBaseURL = url;
             this.name = name;
             this.connection = new BikeShopConnection(name,url,bikeShopBaseURL+"crossdomain.xml",null);
+            _layer = map.addLayer(connection, STYLESHEET);
+            _layer.visible = false;
         }
 
         public function load():void {
-            if (!_layer) {
-                _layer = map.addLayer(connection, STYLESHEET);
-            }
+            _layer.visible = true;
             connection.loadBbox(map.edge_l, map.edge_r, map.edge_t, map.edge_b);
         }
     }
index 4c6f08b..d9caabc 100644 (file)
@@ -27,12 +27,12 @@ package net.systemeD.potlatch2.utils {
             this.name = name;
             this.bugDetailsURL = details;
             connection = new BugConnection(name, url, bugApiKey, details);
+            _layer = map.addLayer(connection, STYLESHEET, true, true);
+            _layer.visible = false;
         }
 
         public function load():void {
-            if (!_layer) {
-                _layer = map.addLayer(connection, STYLESHEET, true, true);
-            }
+            _layer.visible = true;
             connection.loadBbox(map.edge_l, map.edge_r, map.edge_t, map.edge_b);
         }
     }
index 97f92db..e2457a3 100644 (file)
@@ -30,6 +30,8 @@ package net.systemeD.potlatch2.utils {
             this.map = map;
             connection = new SnapshotConnection(name, url, '');
             _stylesheet = (stylesheet && stylesheet != '') ? stylesheet : STYLESHEET;
+            _layer = map.addLayer(connection, _stylesheet, true, true);
+            _layer.visible = false;
         }
 
         /**
@@ -38,9 +40,7 @@ package net.systemeD.potlatch2.utils {
         * automatically to pan / zooming of the associated Map
         */
         public function load():void {
-            if (!_layer) {
-                _layer = map.addLayer(connection, _stylesheet, true, true);
-            }
+            _layer.visible = true;
             connection.loadBbox(map.edge_l, map.edge_r, map.edge_t, map.edge_b);
         }
     }