How do I use UK ordnance survey maps with OpenLayers API without committing myself to using the OpenSpace API. I need to have generic OpenLayers code only.


The way I see it you have two main options.

1) Sign up for OS OnDemand - OS OnDemand is Ordnance Surveys WMS service. once you have access you can call it via a standard OpenLayers WMS call. This is not a free service. The licence for an external facing application is £20,000 a year. They do provide a free trial though.

2) Set up your own WMS loaded with Ordnance Survey OpenData. You can then call this WMS Service from your OpenLayers application. Requires a bit more work but leaves you in control, and if you use an Open Source WMS such as GeoServer then the only costs will be time and effort.

Without more information about what environment you are working in is there isn't much more I can say right now! I hope this helps.

  • I am hoping to develop a GIS application using OpenLayers that can be used in any country. Thus I cannot be tied to the UK Openspace API but need to have access to their ordnance survey maps. I am at a loss to see how to do this and would appreciate any code examples that would implement this. Is there a subclass within OpenLayers.Layer that I could use eg. OpenLayers.Layer.OsOpenspace or something similar. – user19742 Jul 4 '13 at 9:16
  • 2
    @user19742 See BStones answer, there is no custom code needed, just a regular OpenLayers WMS call to either your own WMS with OpenData loaded on or Ordnance Surveys OnDemand WMS. We've done it in our own Web Map Application Dorset Explorer 3 using a mix of OpenStreetMap basemaps and Ordnance Survey stored on our own WMS – Rob Quincey Jul 4 '13 at 10:48
  • 2
    Ordnance Survey has a WMS-T Service as of 26th June 2013. ordnancesurvey.co.uk/oswebsite/support/web-services/… - Code Playground Examples ordnancesurvey.co.uk/oswebsite/support/web-services/… OS Wiki on this osopenwiki.ordnancesurvey.co.uk/wiki/… – Mapperz Jul 4 '13 at 13:37

I have set up something similar which uses OpenLayers and OS OpenData as the basemap. There is no special code for OS data, just a regular WMS layer:

basemap = new OpenLayers.Layer.WMS("Basemapping",
     {layers: 'OpenData'}

The difficult part is getting the OS OpenData in the form of a WMS. See Rob Quincey's answer above for some options.


It might be quite difficult to create a global web application that uses Ordnance Survey data for GB and then other data for the rest of the world because of the projections especially if using the Ordnance Survey Raster data. Ordnance Survey data is British National Grid which is EPSG:27700 and rest of the global datasets are in WGS84 or Google Spherical Mercator.

If you were to use the OS OpenData vector data such as OS VectorMap District, Meridian2 and Strategi, you could potentially re-project these to a global projection that matches your data for the rest of the world, like EPSG:900913/EPSG:3785.

As Rob and BStone advise just load these datasets into a spatial database and use a geographic server like ArcGIS Server or MapServer or GeoServer, style the data as you like and then pull that data into your web mapping application using Openlayers API WMS.

  • We reprojected our OS data into 900913 so we could use it with OpenStreetMap and it worked out alright. There is a slight quality loss when it reprojects it into a round globe, but it's not too bad. – Rob Quincey Jul 5 '13 at 8:10
  • I would be grateful if you could could explain the process whereby I would be able to use the UK ordnance survey map within the OpenLayers API. My problem is total lack of knowledge to accomplish this. – user19742 Jul 5 '13 at 14:07

I have two examples of using OL to load OS tiles directly, but note that you still need to sign up up to Ordnance Survey's OpenSpace to obtain your own key to access the tile server:

OLv2: http://www.macfh.co.uk/JavaJive/ProgScriptWeb/UKOSOpenLayers2.shtml

OLv3: http://www.macfh.co.uk/JavaJive/ProgScriptWeb/UKOSOpenLayers.shtml

(I'm not a fan of OL3, but the example works.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.