OS Openspace Maps

OS Openspace Maps works using the [[osmap]] shortcode anywhere in your post.
It allows maps with markers and gpx or kml files to be shown like the example at the foot of this page.

The following parameters can be passed:

height=”xxx” sets the height of the map div
width=”xxx” sets the width of the map div
colour=”red” or colour=”#ff0000″ sets the colour of the track shown from a file.
gpx=”http://www.example.com/myfile.gpx” specifies a gpx file to be displayed
kml=”http://www.example.com/myfile.kml” specifies a kml file to be displayed
markers=”NY1234512345;Marker 1|54.454198,-3.211527;Marker 2″ a list of positions and labels separated by | with a ; between the position and label. Positions can be 6, 8 or 10 figure grid references or decimal lat long.

To upload a kml or gpx file just use the WordPress media uploader and then copy the address of the uploaded file into the shortcode. (This is how the example below was achieved. The gpx file was exported from a GPS device, showing the route in red and using the GPS coordinates to overlay this on an OS map of the area).

Example Shortcodes

[[osmap height=”300″ width=”300″ color=”yellow” gpx=”http://www.example.co.uk/myfile.gpx”]]

Displays a 300px by 300px window containing a yellow track from the file specified.

[[osmap markers=”NY2000008000;Wasdale”]]

Displays a default size and zoom window with a marker placed and the popup text “Wasdale”

[osmap height=”480″ width=”600″ color=”red” gpx=”https://www.thesmhc.co.uk/wp-content/themes/esplanade/test.gpx”]

You can also create maps with overlays of your desired route for your next walk, for example, then download and save as a .gpx file on this website Create Map With Route Overlay.
An example can be seen on the Sailmhor Croft Post under the weekend meets category.

Leave a Reply

Your email address will not be published. Required fields are marked *