[Commits] r1723 - in sandbox/redlining/ux/FeatureEditing: examples ux ux/widgets ux/widgets/form ux/widgets/plugins

commits at geoext.org commits at geoext.org
Tue Jan 12 19:05:57 CET 2010


Author: adube
Date: 2010-01-12 19:05:56 +0100 (Tue, 12 Jan 2010)
New Revision: 1723

Added:
   sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ExportFeatures.js
   sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ImportFeatures.js
Removed:
   sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ImportFeature.js
Modified:
   sandbox/redlining/ux/FeatureEditing/examples/RedLiningPanelExample.js
   sandbox/redlining/ux/FeatureEditing/ux/FeatureEditing.js
   sandbox/redlining/ux/FeatureEditing/ux/widgets/FeatureEditingControler.js
   sandbox/redlining/ux/FeatureEditing/ux/widgets/form/FeaturePanel.js
   sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ExportFeature.js
Log:
Export as KML button in FeaturePanel

Modified: sandbox/redlining/ux/FeatureEditing/examples/RedLiningPanelExample.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/examples/RedLiningPanelExample.js	2010-01-12 16:44:16 UTC (rev 1722)
+++ sandbox/redlining/ux/FeatureEditing/examples/RedLiningPanelExample.js	2010-01-12 18:05:56 UTC (rev 1723)
@@ -15,8 +15,8 @@
         title: "RedLining Panel",
         region: "east",
         width: 300,
-        plugins: [new GeoExt.ux.ImportFeature(), 
-                  new GeoExt.ux.ExportFeature()]
+        plugins: [new GeoExt.ux.ImportFeatures(), 
+                  new GeoExt.ux.ExportFeatures()]
     });
     
     new Ext.Panel({

Modified: sandbox/redlining/ux/FeatureEditing/ux/FeatureEditing.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/FeatureEditing.js	2010-01-12 16:44:16 UTC (rev 1722)
+++ sandbox/redlining/ux/FeatureEditing/ux/FeatureEditing.js	2010-01-12 18:05:56 UTC (rev 1723)
@@ -57,7 +57,8 @@
         "widgets/form/RedLiningPanel.js",
         "widgets/form/FeaturePanel.js",
 
-        "widgets/plugins/ImportFeature.js",
+        "widgets/plugins/ImportFeatures.js",
+        "widgets/plugins/ExportFeatures.js",
         "widgets/plugins/ExportFeature.js"
     );
 

Modified: sandbox/redlining/ux/FeatureEditing/ux/widgets/FeatureEditingControler.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/widgets/FeatureEditingControler.js	2010-01-12 16:44:16 UTC (rev 1722)
+++ sandbox/redlining/ux/FeatureEditing/ux/widgets/FeatureEditingControler.js	2010-01-12 18:05:56 UTC (rev 1723)
@@ -370,7 +370,9 @@
         var options = {
           autoSave: this.autoSave,
           features: [feature],
-          controler: this
+          controler: this,
+          plugins: [new GeoExt.ux.ExportFeature()]
+
         };
         var featurePanel = new GeoExt.ux.form.FeaturePanel(options);
 

Modified: sandbox/redlining/ux/FeatureEditing/ux/widgets/form/FeaturePanel.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/widgets/form/FeaturePanel.js	2010-01-12 16:44:16 UTC (rev 1722)
+++ sandbox/redlining/ux/FeatureEditing/ux/widgets/form/FeaturePanel.js	2010-01-12 18:05:56 UTC (rev 1723)
@@ -68,7 +68,7 @@
         } else {
             this.features = [features];
         }
-    },   
+    },
 
     /** private: method[initToolbar]
      *  Initialize the controls of the controler and create a toolbar from the

Modified: sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ExportFeature.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ExportFeature.js	2010-01-12 16:44:16 UTC (rev 1722)
+++ sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ExportFeature.js	2010-01-12 18:05:56 UTC (rev 1723)
@@ -2,6 +2,8 @@
 
     controler: null,
 
+    editFeatureForm: null,
+
     init: function(form) {
         this.controler = form.controler;
 
@@ -10,10 +12,16 @@
             handler: this.exportFeatures,
             scope: this
         });
-        form.getTopToolbar().add(action);
+        form.getBottomToolbar().add(action);
+
+        this.editFeatureForm = form;
     },
 
     exportFeatures: function() {
-        GeoExt.ux.data.Export.KMLExport(this.controler.map, this.controler.layers, null);
+        var map = this.controler.map;
+        var layer = this.editFeatureForm.features[0].layer;
+        var features = this.editFeatureForm.features;
+
+        GeoExt.ux.data.Export.KMLExport(map, layer, features);
     }
 });

Added: sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ExportFeatures.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ExportFeatures.js	                        (rev 0)
+++ sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ExportFeatures.js	2010-01-12 18:05:56 UTC (rev 1723)
@@ -0,0 +1,19 @@
+GeoExt.ux.ExportFeatures = Ext.extend(Ext.util.Observable, {
+
+    controler: null,
+
+    init: function(form) {
+        this.controler = form.controler;
+
+        var action = new Ext.Action({
+            text: "Export",
+            handler: this.exportFeatures,
+            scope: this
+        });
+        form.getTopToolbar().add(action);
+    },
+
+    exportFeatures: function() {
+        GeoExt.ux.data.Export.KMLExport(this.controler.map, this.controler.layers, null);
+    }
+});


Property changes on: sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ExportFeatures.js
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Deleted: sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ImportFeature.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ImportFeature.js	2010-01-12 16:44:16 UTC (rev 1722)
+++ sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ImportFeature.js	2010-01-12 18:05:56 UTC (rev 1723)
@@ -1,18 +0,0 @@
-GeoExt.ux.ImportFeature = Ext.extend(Ext.util.Observable, {
-
-    layer: null,
-
-    init: function(form) {
-        this.layer = form.layer;
-        var action = new Ext.Action({
-            text: "Import",
-            handler: this.importFeatures,
-            scope: this
-        });
-        form.getTopToolbar().add(action);
-    },
-
-    importFeatures: function() {
-        GeoExt.ux.data.Import.KMLImport(this.layer.map, this.layer);
-    }
-});

Added: sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ImportFeatures.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ImportFeatures.js	                        (rev 0)
+++ sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ImportFeatures.js	2010-01-12 18:05:56 UTC (rev 1723)
@@ -0,0 +1,18 @@
+GeoExt.ux.ImportFeatures = Ext.extend(Ext.util.Observable, {
+
+    layer: null,
+
+    init: function(form) {
+        this.layer = form.layer;
+        var action = new Ext.Action({
+            text: "Import",
+            handler: this.importFeatures,
+            scope: this
+        });
+        form.getTopToolbar().add(action);
+    },
+
+    importFeatures: function() {
+        GeoExt.ux.data.Import.KMLImport(this.layer.map, this.layer);
+    }
+});


Property changes on: sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ImportFeatures.js
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native



More information about the Commits mailing list