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

commits at geoext.org commits at geoext.org
Wed Jun 29 07:42:51 CEST 2011


Author: cmoullet
Date: 2011-06-29 07:42:51 +0200 (Wed, 29 Jun 2011)
New Revision: 2738

Modified:
   sandbox/cmoullet/ux/LayerManager/ux/data/FormatStore.js
   sandbox/cmoullet/ux/LayerManager/ux/data/Import.js
Log:
Support GPX


Modified: sandbox/cmoullet/ux/LayerManager/ux/data/FormatStore.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/data/FormatStore.js	2011-06-28 14:39:41 UTC (rev 2737)
+++ sandbox/cmoullet/ux/LayerManager/ux/data/FormatStore.js	2011-06-29 05:42:51 UTC (rev 2738)
@@ -17,6 +17,12 @@
         extractAttributes: true,
         kmlns: "http://www.opengis.net/kml/2.2"
     }],
+    ['GPX', 'OpenLayers.Format.GPX', {
+         //extractWaypoints: true,
+         extractTracks: true,
+         //extractRoutes: true,
+         extractAttributes: true
+    }],
     ['GeoJSON', 'OpenLayers.Format.GeoJSON',{}],
     ['GeoRSS', 'OpenLayers.Format.GeoRSS',{}],
     ['GML', 'OpenLayers.Format.GML',{}]

Modified: sandbox/cmoullet/ux/LayerManager/ux/data/Import.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/data/Import.js	2011-06-28 14:39:41 UTC (rev 2737)
+++ sandbox/cmoullet/ux/LayerManager/ux/data/Import.js	2011-06-29 05:42:51 UTC (rev 2738)
@@ -43,6 +43,11 @@
             {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 == 'GPX') {
+            var gpxReader = new OpenLayers.Format.GPX(OpenLayers.Util.extend(
+            {externalProjection: new OpenLayers.Projection("EPSG:4326"),internalProjection: map.getProjectionObject()},
+                    GeoExt.ux.data.formats.getFormatConfig(format)));
+            GeoExt.ux.data.importFeatures = gpxReader.read(filecontent);
         } else if (format == 'GML') {
             var gmlReader = new OpenLayers.Format.GML(GeoExt.ux.data.formats.getFormatConfig(format));
             GeoExt.ux.data.importFeatures = gmlReader.read(filecontent);



More information about the Commits mailing list