Local plotting of GPX file onto Google Maps

I recorded a GPX file using myTrack HD today, and I wanted to overlay it on Google Maps. However, most of the services I’ve seen required you to upload your GPX file and they will process it for you. This is something I feel strongly against doing.

In my search for an local solution (as opposed to uploading it to a server), I found GPX Viewer, an implementation of a GPX parser in Javascript which reads the GPX file and overlays the track. This is all done without uploading any data anywhere.

All it requires is 2 files to be downloaded and it runs really well:

  • loadgpx.4.js
  • gpxviewer.html

To use it, simply download the files onto your desktop (or whichever folder you prefer), then open the gpxviewer.html file in your browser. Put the GPX file into the same folder, then append gpx=<filename> to the URL, so your URL looks like this now:

file:///C:/Users/darell/Desktop/gpxviewer.html?gpx=poco-trail.gpx

If points are too close to each other, some points may not be rendered. To overcome this, I modified gpxviewer.html to add the following lines (or modify the existing ones if you wish):

parser.SetMinTrackPointDelta(0);
parser.SetTrackWidth(2);

You have to add these calls before AddTrackpointsToMap() or AddWaypointsToMap(). They make the track width slightly smaller, and do not check the minimum delta between each points before it is actually plotted.

My main purpose was simply for visualization of the GPX file. I think street view and scroll wheel support would have been good.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s