Add BikeShopLoader to the autovectorbackground. Also remove the bugs and bike shops...
authorAndy Allan <gravitystorm@gmail.com>
Fri, 26 Nov 2010 15:43:54 +0000 (15:43 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Fri, 26 Nov 2010 15:43:54 +0000 (15:43 +0000)
net/systemeD/potlatch2/AutoVectorBackground.as
potlatch2.mxml

index 3e93ea3..762f950 100644 (file)
@@ -6,7 +6,7 @@ package net.systemeD.potlatch2 {
         import flash.net.*
         import net.systemeD.halcyon.Map;
         import net.systemeD.halcyon.DebugURLRequest;
-        import net.systemeD.potlatch2.utils.BugLoader;
+        import net.systemeD.potlatch2.utils.*;
 
         private var map:Map;
 
@@ -30,6 +30,7 @@ package net.systemeD.potlatch2 {
                   break;
                 case "KMLImporter":
                   break;
+
                 case "BugLoader":
                   if (set.url && set.apiKey) {
                     var bugLoader:BugLoader = new BugLoader(map, String(set.url), String(set.apikey));
@@ -40,6 +41,18 @@ package net.systemeD.potlatch2 {
                     trace("AutoVectorBackground: error with BugLoader");
                   }
                   break;
+
+                case "BikeShopLoader":
+                  if (set.url) {
+                    var bikeShopLoader:BikeShopLoader = new BikeShopLoader(map, String(set.url));
+                    if (set.@loaded == "true") {
+                      bikeShopLoader.load();
+                    }
+                  } else {
+                    trace("AutoVectorBackground: no url for BikeShopLoader");
+                  }
+                  break;
+
                 default:
                   trace("AutoVectorBackground: unknown loader");
               }
index 42fa40a..c01e734 100644 (file)
@@ -37,8 +37,6 @@
                                </mx:Array>
                        </mx:dataProvider>
                </mx:PopUpMenuButton>
-        <mx:Button id="bugsButton" label="Bugs" click="bugLoader.load();" visible="false"/>
-        <mx:Button id="bikeButton" label="Bike Shops" click="bikeShopLoader.load();" visible="false" />
         <mx:Spacer width="100%"/>
         <mx:Button label="Undo" click="MainUndoStack.getGlobalStack().undo();"
             enabled="{MainUndoStack.getGlobalStack().canUndo()}"/>
                        // create GPS trackloader
                        trackLoader=new TrackLoader(theMap,conn.apiBase);
 
-            // create Bug loader
-            if (loaderInfo.parameters["bugs_url"] && loaderInfo.parameters["bugs_apikey"]) {
-              bugsButton.visible = true;
-              bugLoader = new BugLoader(theMap, loaderInfo.parameters["bugs_url"], loaderInfo.parameters["bugs_apikey"]);
-            }
-
-            // create Bike Shop loader
-            bikeShopLoader = new BikeShopLoader(theMap, 'http://shaunmcdonald.dev.openstreetmap.org/bike-shop-locator/');
-
             // Force authentication on startup, if required
             // force_auth == force => checks for access token, and displays OAuth panel if needed
             var force_auth:String = loaderInfo.parameters["force_auth"];