[Commits] r1701 - in sandbox/cmoullet/ux/LayerManager/ux: data widgets
commits at geoext.org
commits at geoext.org
Sun Jan 10 20:33:46 CET 2010
Author: cmoullet
Date: 2010-01-10 20:33:46 +0100 (Sun, 10 Jan 2010)
New Revision: 1701
Modified:
sandbox/cmoullet/ux/LayerManager/ux/data/Import.js
sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerImportPanel.js
sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerWindow.js
Log:
Import return layer
Modified: sandbox/cmoullet/ux/LayerManager/ux/data/Import.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/data/Import.js 2010-01-10 19:21:21 UTC (rev 1700)
+++ sandbox/cmoullet/ux/LayerManager/ux/data/Import.js 2010-01-10 19:33:46 UTC (rev 1701)
@@ -19,7 +19,7 @@
* :param filecontent ``String`` The information contained in the import file. Mandatory together with format.
* :param features ``Array(OpenLayers.Feature.Vector)`` (Optional) Array of features.
*
- * :return: ``String`` Exported data.
+ * :return: ``OpenLayers.Layer.Vector`` The layer in which the data are imported.
*/
GeoExt.ux.data.Import = function(map, layer, format, filecontent, features) {
GeoExt.ux.data.Import.importFeatures = [];
@@ -54,6 +54,7 @@
}
layer.addFeatures(GeoExt.ux.data.importFeatures);
+ return layer;
};
/** static: method[GeoExt.ux.data.Import.KMLImport]
Modified: sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerImportPanel.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerImportPanel.js 2010-01-10 19:21:21 UTC (rev 1700)
+++ sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerImportPanel.js 2010-01-10 19:33:46 UTC (rev 1701)
@@ -160,7 +160,7 @@
return;
}
this.fireEvent('beforedataimported', this, this.formatCombo.getValue(), filecontent);
- GeoExt.ux.data.Import(this.map, this.layer, this.formatCombo.getValue(), filecontent, null);
+ this.layer = GeoExt.ux.data.Import(this.map, this.layer, this.formatCombo.getValue(), filecontent, null);
this.fireEvent('dataimported', this, this.formatCombo.getValue(), filecontent, GeoExt.ux.data.importFeatures);
}
},
Modified: sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerWindow.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerWindow.js 2010-01-10 19:21:21 UTC (rev 1700)
+++ sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerWindow.js 2010-01-10 19:33:46 UTC (rev 1701)
@@ -92,6 +92,10 @@
defaultFormat: 'KML'
});
+ this.importPanel.on('dataimported', function(panel, format, filecontent, features) {
+ alert(OpenLayers.i18n("KML data sucessfully imported in layer: " + panel.layer.name + " !" + " Number of imported features: " + features.length));
+ });
+
this.items = [
{
title: OpenLayers.i18n('Export'),
More information about the Commits
mailing list