UK Ordnance Survey Map Layers

Created Using OpenLayers API

The main purpose of this demo is to display the more restricted range of base layers and zoom levels available from the current Open Data Ordnance Survey API compared with the previous, but now sadly withdrawn, OpenSpace© API, and Open Layers v2 was needed for this as later versions do not have the Layer Switcher control (top right hand corner).  However, the demo has also revealed that changing between base layers differing in projection  between the two OS supported projections EPSG:27700, British National Grid, and EPSG:3857, Spherical Mercator  the map centre moves by 191m.  As this is well beyond the level of accuracy of the geographic transformation formulae used, about 5m, the most probable reason for this is that one of the two projections has an incorrect tile origin, most probably the Spherical Mercator projection as maps in this projection are new additions to OS's offerings. However, this author has not been able to prove this to his own satisfaction, and it remains something of a mystery as to where the fault lies and whether it's the OS's or this author's.  However, despite this 'feature', the page still usefully fulfills its intended purpose of demonstrating the current available OS base layers using the Layer Switcher control.

The Overview Map (bottom right hand +) has been somewhat clunky since OL 2.12 inclusive, but, as is done here, can be improved by setting the  minRatio  and  maxRatio  options.  See this page's coding.

Updated Description
2013 & since Page first created & various updates since to keep in step with OpenLayers v2 updates.
Late 2016 Renamed as UKOSOpenLayers2 after updating UKOSOpenLayers to OL3.
03/03/2022 Fixed to work with new Ordnance Survey Mapping & OAuth2 Authentication Service.  Reconciled coding with other OpenLayers v2 maps & demos, so that all are as alike as possible.  Improved display of OS attributions.