- Home
-
Public Sector
Public Sector
Quick links to popular content
- Business
-
Leisure
Leisure
OS getamap – print your route
Have your map custom made
Visit our shop
Read our magazine
-
Education & Research
Education & Research
Schools
Further & Higher Education
Research
General interest
-
About us
About us
Quick links
- Support
OS OpenSpace API code playground
Our code playground is an interactive way for you to explore our API examples and experiment with your own code. You can edit these examples and then download your bespoke code.
Have a play with OS OpenSpace API now
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.
Markers
- 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
- Draggable marker on left map with a synchronising right map
- Linking a marker to a website
Want to commercialise your applications?
You are free to use OS OpenSpace API for any freely accessible application you would like to build. If you are planning on commercialising this application, then you will need to sign up for our OS OpenSpace Pro service which would give you even more great mapping and technical and account management support.
Working with other OS API services
If you wish to use these code samples for OS OpenSpace Pro or OS OnDemand, you will need to make some small changes, as they use product codes rather than resolutions. You will aslo need to change the API URL (provided to you in your welcome pack) to the relevant service. Please see Getting started with OS OpenSpace Pro and OS OnDemand Web Map Tile Service (WMTS-like) for more information.
