kill stupid tab bug
[potlatch2.git] / net / systemeD / potlatch2 / VectorSourceDialog.mxml
index 1e8b244ad5d503b31b18ab9a8d34a3bb1a7169ea..ea11ab44fa142caec7eca23163a14eea3ab9e837 100644 (file)
@@ -63,6 +63,7 @@
        import net.systemeD.potlatch2.utils.KmlImporter;
        import net.systemeD.potlatch2.utils.ShpImporter;
        import net.systemeD.potlatch2.utils.OsmImporter;
+       import net.systemeD.potlatch2.collections.Stylesheets;
     import mx.managers.PopUpManager;
     import mx.events.DataGridEvent;
     import mx.events.CloseEvent;
@@ -96,7 +97,7 @@
 
        [Bindable(event="bogus")]
        public function get styles():ArrayCollection {
-               return new ArrayCollection(Application.application.theController.stylesheets);
+               return new ArrayCollection(Stylesheets.instance().collection);
        }
 
        [Bindable(event="layers_changed")]
                if (type=='gpx') { stylesheet="gpx.css"; }
                var vectorlayer:VectorLayer=new VectorLayer(name,map,stylesheet);
                vectorlayer.url=url;
-               map.addVectorLayer(vectorlayer);
+
+                var filesLoaded:Function = function(success:Boolean,message:String=null):void {
+                        if (success) {
+                                map.addVectorLayer(vectorlayer);
+                                dispatchEvent(new Event("layers_changed"));
+                        } else {
+                                Alert.show(message, 'Error', mx.controls.Alert.OK);
+                        }
+                }
 
                if (type=='gpx') {
                        var gpx:GpxImporter=new GpxImporter(vectorlayer, vectorlayer.paint, [url], filesLoaded, simplify);
                                                            [url+".shp",url+".shx",url+".dbf"], filesLoaded, simplify);
                }
        }
-       
-       public function filesLoaded(success:Boolean,message:String=null):void {
-               if (success) {
-                       dispatchEvent(new Event("layers_changed"));
-               } else {
-                       Alert.show(message, 'Error', mx.controls.Alert.OK);
-               }
-       }
 
               ]]>
   </mx:Script>