<div dir="ltr"><div>You don't need to create the actual ".gpx" file in the client side. Sending an email would require you to:</div><div><br></div><div>1) create a web service that accepts the email address and the gpx file contents, and sends the email with the content encoded as an attachment.</div>

<div>2) call that service sending the file content as the request payload (see AJAX).</div><div><br></div><div>There's plenty of info about that on the Internet.</div><div><br></div><div>B</div><div class="gmail_extra">

<br><div class="gmail_quote">2014-04-18 21:41 GMT+02:00 ANC <span dir="ltr"><<a href="mailto:anajera@bicimapas.com.mx" target="_blank">anajera@bicimapas.com.mx</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Hello<br>
<br>
I have a mobile app that captures the path a user is following using<br>
geolocation's watch mode. The path points are added to a vector layer. Once<br>
the path capture is finished I want to create a GPX file out of it and email<br>
it to a user selected email address from the mobile device.<br>
<br>
The vector layer where the path points are captured is named "path", the map<br>
is in 4326 projection and I am using this code to parse the features as GPX:<br>
<br>
var pathfeatures = path.features();<br>
<br>
var gpxformat = new OpenLayers.Format.GPX({<br>
            internalProjection: new OpenLayers.Projection("EPSG:4326"),<br>
            externalProjection: new OpenLayers.Projection("EPSG:4326")<br>
        });<br>
<br>
var gpxcontents = gpxformat.write(pathfeatures);<br>
<br>
My questions are:<br>
<br>
1. How do I create the actual GPX file from the "gpxcontents" variable,<br>
something like "path.gpx"?<br>
2. Once the gpx file is created, how can I send it as an email attachment?<br>
<br>
I have searched this forum as well as other resources and have not been able<br>
to find a guideline. I know the second question may not be OpenLayers<br>
related but any help will be appreciated.<br>
<br>
Thank you<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Create-and-Email-GPX-file-from-Vector-layer-tp5135947.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/Create-and-Email-GPX-file-from-Vector-layer-tp5135947.html</a><br>



Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</blockquote></div><br></div></div>