Jump to the following:

By continuing, you agree to the use of cookies by us and third parties, which we use to improve your visit.

Using OS OnDemand WMTS FAQs

How do I access OS OnDemand WMTS?

Configuring the WMTS explains how you can access OS OnDemand in different ways:

  • OGC WMTS Tile Requests via GIS or web based clients subject to additional registration (ESRI V10.1 only)
  • Via the API through an Internet Browser
  • XYZ Style Tile Requests via GIS or web based clients
  • via OS OpenSpace iOS SDK (software Development Kit), which provides access for iOS based devices
  • via OS OpenSpace Android SDK (software Development Kit), which provides access for Android based devices

Please contact us if you require further information.

Can I access OS OnDemand WMTS using a username and password?

No. We will provide you with a URL that will enable your client software to link to our tile services Get Capabilities document.

What is a client referrer URL?

This is the URL that your client software returns when making a call to our service.

Can I gain access to the service through OpenLayers?

Although OS OnDemand WMTS can be accessed directly through OpenLayers, we cannot offer support for this access method.

Can I use localhost to develop?

OS OnDemand WMTS has been configured to work using localhost prior to go live. Once you have completed your development you need to ensure that your registered url is the host url for your website. Once you have checked this you will need to add all your code to your site.

To add your code to your site you can use an FTP client, most hosts/providers supply an FTP service free of charge, although some do charge.

Use the FTP client to upload your HTML file.

Once you have uploaded your HTML file to a server using an FTP client you will need to add a script to your page. In your web site page, where you want the web-map to appear, insert the following code at an appropriate point into the source of the page using a text editor or your blog application:

Please find/copy the code snippet here

We are aware of an issue using localhost in IE. We therefore suggest using an alternative web browser such as firefox or chrome.

Do you have technical documentation for the OS OnDemand WMTS?

Yes; please see our documentation page.

How can I add more URLs to my API key?

Contact us and we will register the new URLs against your API key.

I have input the correct API key provided but I am unable to obtain any mapping. Why is this?

Firstly, ensure that the API key has been included in the correct 'case'. If this does not resolve the issue, please contact us.

How do I request a small OS OpenSpace API build?

The OpenSpace API can be requested in two sizes – the default large size which includes all of the features from OpenLayers and a new small size which excludes the less used features.

The small version can be requested by adding the parameter b=small to your API request:

script src='http://openspace.ordnancesurvey.co.uk/osmapapi/openspace.js?key=INSERT_YOUR_API_KEY_HERE&b=small>

The large size is the default version however this can be specifically requested by adding the parameter b=large

script src='http://openspace.ordnancesurvey.co.uk/osmapapi/openspace.js?key=INSERT_YOUR_API_KEY_HERE&b=large>

To see which features are included or excluded from either build please add the debug parameter debug=true which provides the unminified code including a list of the included and excluded OpenLayers classes.

What are the OS OnDemand WMTS Product Codes?

To achieve a friendly zoomed in/out effect, each product type has a suitable resolution measured in metres per pixel at which it should be viewed in a web application.

Each product type (except Overview maps) has been provided at two zoom levels or resolutions. When a product is Resampled it is twice the original resolution. 'R' denotes a resampled product.

Learn more

How can I obtain access to the zoom map stack?

For full use of the zoom map stack, you will need to be licensed for GB coverage of our OSVectorMap Local product. Once this has been arranged, the layers will be made available. Details of the product layers can be found in the table above.

Why can I not see the mapping for all the requested layers?

If you are using a combination of layers from both the original and from the zoom map stack, you will need to include them in your code, ordered by resolution. This will ensure that mapping will be shown for all layers that have an overlapping resolution. See exmaple below:

{products: ["OV0", "OV1", "OV2", "CS04", "250KR", "CS05", "250K", "VMDR", "VMD", "VMLR", "VML"]};

Does OS OnDemand offer any look-ups?

Yes, OS OnDemand WMTS API offers three look-ups:

  • Code-point Open for postcode look-up
  • Boundary-Line Data for boundary information
  • 1:50 000 Scale Gazetteerfor place name search
I keep getting an 'HTTP referrer' error; why is this?

This is usually because the registered URL is not correctly registered. You need to ensure that you have registered two types of URLs for your application, for example:




If you do need to register an additional URL, please contact us stating your API Key and the URL that you need us to add for you.

Can I use the Web-Map Builder tool to create some code?

Yes, subject to some small code changes. Copy the code created in the WebMap Builder tool and paste it into Notepad or another text file programme.

src="http://ondemandapi.ordnancesurvey.co.uk/osmapapi/openspace.js?key=insert_your_api_key_here" type="text/javascript"

Locate the line towards the top where the URL and API key for OS OnDemand is inserted between the script tags (see example below):

type="text/javascript" src=http://openspace.ordnancesurvey.co.uk/osmapapi/openspace.js?key=insert_your_api_key_here

change to

type="text/javascript" src=http://ondemandapi.ordnancesurvey.co.uk/osmapapi/openspace.js?key=insert_your_api_key_here

the text 'insert_your_api_key_here'

the text 'insert_your_api_key_here' should be overtyped with the API key provided to you in your welcome letter.

A second change is required to the section in the code that declares map options. Locate the line:

//initiate the map

var options = {resolutions: [2500, 1000, 500, 200, 100, 50, 25, 10, 5, 4, 2.5, 2, 1]};

osMap = new OpenSpace.Map('map', options);

change to

var options = {products: ["OV0", "OV1", "OV2", "MSR", "MS", "250KR", "250K", "50KR", "50K", "25KR", "25K", "VMDR", "VMD", "VMLR", "VML", "SVR", "SV"]};

osMap = new OpenSpace.Map('map',options);

The product codes for the zoom map stack can also be added here.

Do you have any code examples that I can use?

Yes, our code playground provides you with numerous examples.

Back to top
© Ordnance Survey 2019