[OpenLayers-Users] Create and Email GPX file from Vector layer

Borja Lafuente borlafu at gmail.com
Thu May 29 13:44:44 PDT 2014


You don't need to create the actual ".gpx" file in the client side. Sending
an email would require you to:

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.
2) call that service sending the file content as the request payload (see
AJAX).

There's plenty of info about that on the Internet.

B

2014-04-18 21:41 GMT+02:00 ANC <anajera at bicimapas.com.mx>:

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


More information about the Users mailing list