joriszwart.nl

Dropzone GPX preview

GPX element

I wrote a client-side plugin for Dropzone to preview GPX1 files in Dropzone.

Purpose

To get useful feedback before uploading a file. Visibility of System Status.

Implementation

Unfortunately I cannot disclose the source code nor a demo, but the overall process is like this:

  1. Parse the GPX file into an XML DOM.
  2. Transforming the geographic coordinates to a suitable view box.
  3. Render the coordinates as SVG’s polyline.
  4. Serialize the model to a SVG as XML-string.
  5. Set the resulting SVG as a background to the Dropzone preview.

Related