[Commits] r1731 - sandbox/cmoullet/ux/LayerManager/ux/data

commits at geoext.org commits at geoext.org
Wed Jan 13 08:29:13 CET 2010


Author: cmoullet
Date: 2010-01-13 08:29:13 +0100 (Wed, 13 Jan 2010)
New Revision: 1731

Modified:
   sandbox/cmoullet/ux/LayerManager/ux/data/Export.js
Log:
Export features than layers


Modified: sandbox/cmoullet/ux/LayerManager/ux/data/Export.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/data/Export.js	2010-01-13 06:58:07 UTC (rev 1730)
+++ sandbox/cmoullet/ux/LayerManager/ux/data/Export.js	2010-01-13 07:29:13 UTC (rev 1731)
@@ -22,22 +22,23 @@
     var exportLayers = [];
     var exportFeatures = [];
 
-    if (layers) {
-        exportLayers = layers;
+    // Export first the features
+    if (features) {
+        exportFeatures = features;
     } else {
-        for (var i = 0; i < map.layers.length; i++) {
-            var layer = map.layers[i];
-            if (layer.CLASS_NAME) {
-                if (GeoExt.ux.data.Export.isLayerSupported(layer.CLASS_NAME)) {
-                    exportLayers.push(layer);
+        // If no features set, export the layers
+        if (layers) {
+            exportLayers = layers;
+        } else {
+            for (var i = 0; i < map.layers.length; i++) {
+                var layer = map.layers[i];
+                if (layer.CLASS_NAME) {
+                    if (GeoExt.ux.data.Export.isLayerSupported(layer.CLASS_NAME)) {
+                        exportLayers.push(layer);
+                    }
                 }
             }
         }
-    }
-
-    if (features) {
-        exportFeatures = features;
-    } else {
         for (var j = 0; j < exportLayers.length; j++) {
             var exportLayer = exportLayers[j];
             if (exportLayer.features) {
@@ -66,23 +67,23 @@
 };
 
 /** static: property[GeoExt.ux.data.Export.content]
-*  ``String`` Export content
-*/
+ *  ``String`` Export content
+ */
 GeoExt.ux.data.Export.content = null;
 
 /** static: property[GeoExt.ux.data.Export.format]
-*  ``String`` Export format
-*/
+ *  ``String`` Export format
+ */
 GeoExt.ux.data.Export.format = null;
 
 /** static: property[GeoExt.ux.data.Export.format]
-*  ``GeoExt.ux.LayerManagerExportWindow`` Export window
-*/
+ *  ``GeoExt.ux.LayerManagerExportWindow`` Export window
+ */
 GeoExt.ux.data.Export.exportWindow = null;
 
 /** static: property[GeoExt.ux.data.Export.SupportedLayerType]
-*  ``Array(String)`` Array of supported layer type: 'OpenLayers.Layer.Vector','OpenLayers.Layer.WFS','OpenLayers.Layer.GML','OpenLayers.Layer.GeoRSS'
-*/
+ *  ``Array(String)`` Array of supported layer type: 'OpenLayers.Layer.Vector','OpenLayers.Layer.WFS','OpenLayers.Layer.GML','OpenLayers.Layer.GeoRSS'
+ */
 GeoExt.ux.data.Export.SupportedLayerType = [
     ['OpenLayers.Layer.Vector'],
     ['OpenLayers.Layer.WFS'],



More information about the Commits mailing list