Jump to the following:

We use cookies to improve this website. Read about cookies

Configuring the OS OnDemand Web Map Tile Service

The OS OnDemand Web Map Tile Service (WMTS) delivers pre-rendered tiles over the internet making it ideal for fast data serving to external internet sites.

To use OS OnDemand WMTS you will need:

  • Current GB coverage licences for the products you wish to access
  • A licence for the service
  • An API key which we will send you when you apply for a licence.
  • Compliant GIS or a web browser

The API key is unique to your licence and you must therefore include it in any URL request or created code used to access the service. If you want to add more URLs to your API key, please contact us and we will register the new URLs against your API key.

Accessing WMTS

Our WMTS can be accessed in the following ways:

OCG WMTS Tile Requests

Our tile service supports the OGC WMTS standard and can be accessed via GIS or web based clients. The WMTS offers the consistently styled zoom map stack of mapping using OGC WMTS tile requests.

To access the service you need:

  • compliant GIS (such as ArcGIS 10.1 or Geocortex)
  • a URL provided by us to enable your client software to link to our tile services Get Capabilities document (see below example)
  • client referrer URL registered against your API key. This is the url that your client software returns when making a call to our service.

Example URL via a web map browser:
http://ondemandapi.ordnancesurvey.co.uk/osmapapi/wmts/INSERT_YOUR_KEY_HERE/ts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=osgb&STYLE=default&FORMAT=image/png&TILEMATRIXSET=ZoomMap&TILEMATRIX=00&TILEROW=3&TILECOL=1&URL=client_referrer_registered_url

We will be adding alternative authentication methods such as http basic and IP ranges at a later date.

Please contact us should you wish to evaluate this method.

Via the API

OS OnDemand uses a JavaScript API, software code that you can embed in your web application. This provides you with all the necessary functionality to interact with a map, such as panning, zooming in and out, and adding markers and polygons.

To access the service you need access to a web browser. You should also have:

  • Notepad or another text file program (to edit and save code).
  • Created Javascript code to embed maps.

For code examples and to explore how you can use your code with our code, visit the OS OnDemand Code Playground

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

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

When 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 example below:

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

Boundary look-ups

The link below details the resolutions for the boundary areas by area code:

https://openspace.ordnancesurvey.co.uk/openspaceforum/thread.jspa?threadID=257&tstart=0

Learn more about boundary look-ups.

//osMap = new OpenSpace.Map('map');

Configuring OS OnDemand WMTS dataset request
We have provided a method to request products using Product Codes. Subject to licensing, your application can request additional datasets including 1:25k, Vector Map Local and the zoom map stack. Each mapping product has a unique product code (see table below for information).

If you used our Web Map Builder tool to create your code or are migrating from OS OpenSpace, you will need to replace or comment out this piece of code that provides the default products:

var options = {products: ["OV0", "OV1", "OV2", "MSR", "MS", "250KR", "250K", "50KR",  "50K", "VMDR", "VMD", "VMLR", "VML"]};        osMap = new OpenSpace.Map('map',options);

//osMap = new OpenSpace.Map('map');

var options = {products: ["50KR", "50K", "VMDR", "VMD", "SVR", "SV"]};osMap = new OpenSpace.Map('map',options);

and replace it with code that requests products by Product Code. Its important to insert a correct sequence of product codes i.e Insert small scale products first (most zoomed out). To use product codes correctly they need to be ordered according to resolution, so the resolution order (as represented by the product codes) must be in high to low order.

In the following example, Vector Map Local has been included:

var options = {products: ["OV0", "OV1", "OV2", "MSR", "MS", "250KR", "250K", "50KR", "50K", "VMDR", "VMD", "VMLR", "VML"]}; osMap = new OpenSpace.Map('map',options);

In the following example, 50k, Vector Map District and StreetView are shown:

var options = {products: ["50KR", "50K", "VMDR", "VMD", "SVR", "SV"]};osMap = new OpenSpace.Map('map',options);

XYZ Style Tile Requests

Our tile service supports XYZ Style Tile requests and can be accessed via GIS or web based clients. To access the service you need:

  • compliant GIS (such as ArcGIS 10.1 or Geocortex)
  • a URL provided by us to enable your client software to link to our tile services Get Capabilities document (see below example)
  • client referrer URL registered against your API key. This is the url that your client software returns when making a call to our service.

Example URL:
http://ondemandapi.ordnancesurvey.co.uk/osmapapi/tile/INSERT_YOUR_KEY_HERE/Z/X/Y.png?URL=client_referrer_registered_url

To use the XYZ style requests there are some additional complexities. In "standard" XYZ requests the z is the zoom level. For our consistently styled zoom map stack this is true - albeit with the prefix "CS" - and resolution goes up in factors of 2 as with other XYZ tile servers.
However our traditional raster stack was not built specifically for web usage and so the resolutions do not go up smoothly. In this case the z is the product code (see table below).

To convert from a grid reference to a specific tile request

The XYZ style makes as assumption that the grid starts from the top left which is opposite to where the British National Grid starts so the y is in fact top of the National Grid -y.

To calculate which tile cell in the XYZ grid you need to call, first find the resoltuion of the layer (shown in the table linked above) and the tile size for that layer (either 250px or 200px). To calculate the frid cell from this take the x coordinate and divide it by the tile size in meters (which is resolution * tile size in pixels) and round it. For the y coorinate you need to subtract this from the most northerly line in the national grid - 1344000 - and then divide it as before and round it.

So to get the tile in an XYZ format for point 400000 400000 and product Miniscale (MS) the following would be needed:

X = 400000 / 20000
Y = (1344000 - 400000) / 20000

So X = 20 and Y = 47.2 (rounded to 47) and results in the following URL

http://ondemandapi.ordnancesurvey.co.uk/osmapapi/tile/INSERT_YOUR_KEY_HERE/MS/20/47.png?url=client_referrer_REGISTERED_URL

Please contact us should you wish to evaluate this method.

Technical Documentation

OS OnDemand WMTS uses the OpenSpace API. Details of OpenSpace API technical documentation is available together with details of the release notes.

Mapping Layers and Look-ups

The following mapping layers are available through OnDemand WMTS. In order to achieve a friendly zoomed in/out effect, each product type has a suitable resolution measured in meters 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.

ProductResolutionIndexTile Size (px)Tile size (m)
OS VectorMap® Local1VML250250
OS VectorMap® Local Resampled 2VMLR250500
1:25 000 Scale Colour Raster2.525K200500
1:25 000 Scale Colour Raster Resampled425KR2501000
1:50 000 Scale Colour Raster550K2001000
1:50 000 Scale Colour Raster Resampled 1050KR2002000
*GB Overview2500OV2
*GB Overview+1000OV1200200000
*GB Overview2500OV0
OS OpenData™ products
OS Street View® (1:10 000 scale)1SV250250
OS Street View® (1:10 000 scale) Resampled2SVR250500
OS VectorMap® District2.5VMD200500
OS VectorMap® District Resampled 4VMDR2501000
1:250 000 Scale Colour Raster25250K2005000
1:250 000 Scale Colour Raster Resampled50250KR20010000
MiniScale®100MS20020000
MiniScale® Resampled 200MSR20040000
1:50 000 Scale Gazetteer **
Boundary-Line™ **
Code-Point Open **
Zoom Map Stack
Generated from Strategi®896CS00250224000
Generated from Strategi®448CS01250112000
Generated from Strategi and Land-Form PANORAMA®224CS0225056000
Generated from Strategi and Land-Form PANORAMA®112CS0325028000
Generated from Strategi and Land-Form PANORAMA®56CS0425014000
Generated from Strategi and Land-Form PANORAMA®28CS052507000
Generated from OS VectorMap® District & Strategi® & Land-Form PANORAMA®14CS062503500
Generated from OS VectorMap® District & Strategi® & Land-Form PANORAMA®7CS072501750
Generated from OS VectorMap® District & Strategi® & Land-Form PANORAMA®3.5CS08250875
Generated from OS VectorMap® Local1.75CS09250437.5
Generated from OS VectorMap® Local0.875CS10250218.75

*These do not form part of the Ordnance Survey product portfolio but are used to provide context at very small scales. No licensing restrictions apply.
** Look ups

There are two options for viewing the map content as a standard set of files or as a consistent seamless zoom stack. If you wish to get access to the full 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. You will automatically get access to layers CS00 to CS08.

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