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

commits at geoext.org commits at geoext.org
Sun Jan 17 07:26:54 CET 2010


Author: cmoullet
Date: 2010-01-17 07:26:54 +0100 (Sun, 17 Jan 2010)
New Revision: 1761

Modified:
   sandbox/cmoullet/ux/LayerManager/ux/data/Export.js
   sandbox/cmoullet/ux/LayerManager/ux/data/Import.js
Log:
Support externalProjection and internalProjection for KML. a feature in OL doesn't contain a SRS...


Modified: sandbox/cmoullet/ux/LayerManager/ux/data/Export.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/data/Export.js	2010-01-17 05:34:18 UTC (rev 1760)
+++ sandbox/cmoullet/ux/LayerManager/ux/data/Export.js	2010-01-17 06:26:54 UTC (rev 1761)
@@ -50,7 +50,9 @@
     }
 
     if (format == 'KML') {
-        var kmlWriter = new OpenLayers.Format.KML(GeoExt.ux.data.formats.getFormatConfig(format));
+        var kmlWriter = new OpenLayers.Format.KML(OpenLayers.Util.extend(
+        {externalProjection: new OpenLayers.Projection("EPSG:4326"),internalProjection: map.getProjectionObject()},
+                GeoExt.ux.data.formats.getFormatConfig(format)));
         return kmlWriter.write(exportFeatures);
     } else if (format == 'GeoJSON') {
         var geojsonWriter = new OpenLayers.Format.GeoJSON(GeoExt.ux.data.formats.getFormatConfig(format));

Modified: sandbox/cmoullet/ux/LayerManager/ux/data/Import.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/data/Import.js	2010-01-17 05:34:18 UTC (rev 1760)
+++ sandbox/cmoullet/ux/LayerManager/ux/data/Import.js	2010-01-17 06:26:54 UTC (rev 1761)
@@ -26,7 +26,9 @@
 
     if (format && filecontent) {
         if (format == 'KML') {
-            var kmlReader = new OpenLayers.Format.KML(GeoExt.ux.data.formats.getFormatConfig(format));
+            var kmlReader = new OpenLayers.Format.KML(OpenLayers.Util.extend(
+            {externalProjection: new OpenLayers.Projection("EPSG:4326"),internalProjection: map.getProjectionObject()},
+                    GeoExt.ux.data.formats.getFormatConfig(format)));
             GeoExt.ux.data.importFeatures = kmlReader.read(filecontent);
         } else if (format == 'GML') {
             var gmlReader = new OpenLayers.Format.GML(GeoExt.ux.data.formats.getFormatConfig(format));
@@ -80,7 +82,7 @@
         modal: true,
         title: OpenLayers.i18n('Import KML'),
         height: 135,
-        width: 275,
+        width: 290,
         items: [
             importPanel
         ]



More information about the Commits mailing list