Initialise the tile set in case the imagery catalogue has already loaded
authorRichard Fairhurst <richard@systemeD.net>
Sun, 25 Mar 2012 18:03:19 +0000 (19:03 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Sun, 25 Mar 2012 18:03:19 +0000 (19:03 +0100)
from https://github.com/tomhughes/potlatch2/commit/7875a252f6ea84abb2fe6e0019da1366bc701740

potlatch2.mxml

index c11a7bf..e6a8462 100644 (file)
                        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, yahoo);
+                       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);