Jump to the following:

We use cookies to improve this website. Read about cookies

OS OnDemand WMTS code playground

Our code playground is an interactive way for you to explore how you can use our code with your own code. You can edit these examples and then download your bespoke code.

Have a play with the code

1. Click on one of the example links below, it will show the end result of the example code.

2. Click on ‘Edit in Code Playground’ to see the HTML and JavaScript codes. You can also click on ‘Real-time preview’ to see the map change as you change the code.

3. Click ‘Render’ to go back to the full view of the map.

4. Click ‘Download’ to download the full code merged into one HTML file, ready for you to use.

You will need to make some small changes, as OS OnDemand WMTS uses product codes rather than resolutions. You will also need to change the API URL to the one provided to you in your welcome pack. Please see OS OnDemand Web Map Tile Service (WMTS) for more information.

Basic Maps

Creating lines and polygons

Markers

Administrative Boundaries

Overlays

Back to top
© Ordnance Survey 2016
Be sure to take a look at our Terms of Use and Privacy Policy