The Ordnance Survey now have a free map drawing system, similar to Google Maps, from https://openspace.ordnancesurvey.co.uk/ just request a free API key. As an example we have written a simple JavaScript program to display your GPX track on a map, e.g. https://osgb.ndrw.co.uk/gpx_track/gpx_track.html?test.gpx The tracks will be displayed on a 1:50000 scale map.
It is assumed you know how to create a GPX file of your track, if not G7ToWin is very simple to use, just upload the track from your GPS unit and Save As a GPX file.
There are just 3 files, a web page gpx_track.html,
and the
JavaScript file gpx_track.js,
and a test GPX file
test.gpx
download the zip file from here (23 KB)>/p>
Edit gpx_track.html
, replace our API key with yours, if you want to
modify the map size change the 600 values to a size you prefer:->/p>
<div id="map" style="width: 600px; height: 600px; border: 1px solid
black;"></div>
That is it you have finished, unless you want to change some parts of the JavaScript file, but the default values will work for a test, the only lines that need changing are:-
var gbCheckTime = false; // set to true to enable time checking
var gbDebug = false; // false to turn off debugging
var gTimeInc = 20000; // Milliseconds between way points
gbCheckTime |
A GPX track can have thousands of way points in it, to reduce the
amount, which speeds up the drawing the track via your browser, set
this to:-
true
It is recommended that this is used, I have my GPS set to save way points every 20 seconds, this considerably reduces the memory the GPS unit requires, and produces a much smaller GPX file. I tend to use my GPS when I am walking, in 20 seconds I have not walked very far. |
gbDebug |
To output some debug info set this to:-
true
|
gTimeInc |
The time, in milliseconds, between way points. The assumption is made that the track way points start from the earliest to the latest, sometimes this may not be the case. If you use G7toWin check that the first track element does not have today's date and time, if it is simply delete this element by right clicking on it. |
<time>2006-01-18T12:52:22Z</time>
.The GPX file should look something like this, it is a text file so it can be viewed in any text editor.
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx xmlns= ...>
<metadata>
<link href="https://www.gpsinformation.org/ronh/g7towin.htm">
<text>G7ToWin</text>
</link>
<time>2008-02-14T12:35:18Z</time>
<bounds minlat="53.33" minlon="-1.732" maxlat="53.36"
maxlon="-1.64"/>
</metadata>
<trk>
<name>ACTIVE LOG</name>
<type>Track black</type>
<trkseg>
<trkpt lat="53.330619335" lon="-1.661531925">
<time>2008-02-12T09:47:09Z</time>
</trkpt>
</trkseg>
<trkseg>
<trkpt lat="53.330619335" lon="-1.661531925">
<time>2008-02-12T09:47:09Z</time>
</trkpt>
</trkseg>
</trk>
</gpx>