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.
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 Map
- Basic Map with place name search
- Basic Map with OS VectorMap District
- Basic Fullscreen Map
Creating lines and polygons
- Adding a marker
- Adding two or more markers
- Adding a custom marker
- Add text, links and images to a marker
- Add markers and text from a file
- Add markers and text from a file with clustering
- Add/delete/drag a marker – click or touch
- Linking markers to websites
- Display an administrative boundary
- Displaying specific boundaries by id
- Creating Thematic Boundaries
- Creating a boundary layer with hover control