Don't draw abandoned railways when they're now highways
[potlatch2.git] / potlatch2.mxml
index 9137c59..76245e4 100644 (file)
                        saveLabel=saveButton.label;
 
                        // populate sharedObject with loaderInfo parameters if supplied
-                       var obj:SharedObject = SharedObject.getLocal("user_state");
+                       var obj:SharedObject = SharedObject.getLocal("user_state","/");
                        var objChanged:Boolean = false;
                        if (loaderInfo.parameters['tileurl']) {
                                obj.setProperty('background_url',loaderInfo.parameters['tileurl']); 
                        // pass additional parameters to map
                        var params:Object={}; var k:String;
                        for (k in this.loaderInfo.parameters) params[k]=this.loaderInfo.parameters[k];
-                       for (k in SharedObject.getLocal('user_state').data) params[k]=SharedObject.getLocal('user_state').data[k];
+                       for (k in SharedObject.getLocal('user_state',"/").data) params[k]=SharedObject.getLocal('user_state',"/").data[k];
 
                        // Create map
                        theMap=new Map();
                        theMap.tileset.blocks=[/google\./i];    // hard-coded block on Google tiles
                        theMap.tileset.setDimming(params['background_dim']    ==null ? true  : params['background_dim']);
                        theMap.tileset.setSharpen(params['background_sharpen']==null ? false : params['background_sharpen']);
-                       Imagery.instance().init(theMap, overlay);
-                       Imagery.instance().addEventListener(MapEvent.BUMP, bumpHandler);
-                       Imagery.instance().addEventListener(CollectionEvent.SELECT,
+                       var imagery:Imagery = Imagery.instance();
+                       imagery.init(theMap, overlay);
+                       imagery.addEventListener(MapEvent.BUMP, bumpHandler);
+                       imagery.addEventListener(CollectionEvent.SELECT,
                                function(e:CollectionEvent):void { theMap.tileset.init(e.data, e.data!=''); }
                        );
+                       theMap.tileset.init(imagery.selected, imagery.selected != '');
                        
                        // keyboard event attached to stage
                        stage.addEventListener(KeyboardEvent.KEY_UP, theMap.keyUpHandler);
                        theController.addEventListener(AttentionEvent.ALERT, onAlert);
             
             // set the access token from saved cookie
-            var tokenObject:SharedObject = SharedObject.getLocal("access_token");
+            var tokenObject:SharedObject = SharedObject.getLocal("access_token","/");
             conn.setAccessToken(tokenObject.data["oauth_token"], tokenObject.data["oauth_token_secret"]);
 
             // Load any requested GPX track
 
                 var connection:Connection = new Connection(name, gpx_url, null, null);
                 var gpx:GpxImporter=new GpxImporter(connection, theMap,
-                                                function(success:Boolean,message:String=null):void {
+                                                function(connection:Connection,options:Object,success:Boolean,message:String=null):void {
                                                     if (!success) return;
                                                     var paint:MapPaint = theMap.addLayer(connection, "stylesheets/gpx.css");
                                                     paint.updateEntityUIs(false, false);