Hello List,
i'm trying to export my feature layer as gpx file. On one Side it seems to work, because i get something like this:
<?xml version="1.0"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" creator="OpenLayers" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<gpx:trk xmlns:gpx="http://www.topografix.com/GPX/1/1">
<gpx:name>OpenLayers.Feature.Vector_3254</gpx:name>
<gpx:desc>No description available</gpx:desc>
<gpx:trkseg>
<gpx:trkpt lon="7.406179800059247" lat="51.93181443052624"/>
<gpx:trkpt lon="7.405849584041292" lat="51.93169308966569"/>
<gpx:trkpt lon="7.402611804857786" lat="51.9305432307448"/>
<gpx:trkpt lon="7.4024607964425595" lat="51.93048265696835"/>
</gpx:trkseg>
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" creator="OpenLayers" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<gpx:trk xmlns:gpx="http://www.topografix.com/GPX/1/1">
<gpx:name>OpenLayers.Feature.Vector_3254</gpx:name>
<gpx:desc>No description available</gpx:desc>
<gpx:trkseg>
<gpx:trkpt lon="7.406179800059247" lat="51.93181443052624"/>
<gpx:trkpt lon="7.405849584041292" lat="51.93169308966569"/>
<gpx:trkpt lon="7.402611804857786" lat="51.9305432307448"/>
<gpx:trkpt lon="7.4024607964425595" lat="51.93048265696835"/>
</gpx:trkseg>
On the other side, this track doesn't show up when i load it into qgis. Is this a version conflict? When i delete the "gpx:" everywhere the gpx shows up in qgis. But both are valid xml's.
The second thing i'm facing at the moment is how to download the gpx file on the client side after it was generated. Has anyone already a solution for this? I tried it the following way:
onDownloadGPXClick: function(grid, view, rowIndex, colIndex ){
var routingLayer = this.getMappanel().map.getLayersByName(Constants.routingLayer)[0];
var features = routingLayer.features;
var format = new OpenLayers.Format.GPX({
internalProjection: this.getMappanel().map.baseLayer.projection,
externalProjection: new OpenLayers.Projection("EPSG:4326")
});
gpx = format.write(features);
var a = document.createElement('a');
a.href = "" + base64.encode(gpx);
a.download = 'gpx-export.gpx';
return window.open(a);
},
var routingLayer = this.getMappanel().map.getLayersByName(Constants.routingLayer)[0];
var features = routingLayer.features;
var format = new OpenLayers.Format.GPX({
internalProjection: this.getMappanel().map.baseLayer.projection,
externalProjection: new OpenLayers.Projection("EPSG:4326")
});
gpx = format.write(features);
var a = document.createElement('a');
a.href = "" + base64.encode(gpx);
a.download = 'gpx-export.gpx';
return window.open(a);
},
Thanks for any help
Christian
_______________________________________________ Users mailing list us...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-users