Ordnance Survey - OS Opendata

Digimap OpenStream WMS Products Map

To embed an OpenLayers map in your web page add the following code to your html page. Don't forget to add your api key!

<script src='http://openlayers.org/api/OpenLayers.js'></script>
var map;
var bounds = new OpenLayers.Bounds (0, 0, 700000, 1300000);
var apikey = "[YOUR API KEY]";
var cache = "true"; 
var attr = "Contains Ordnance Survey data. (c) Crown copyright and database right 20XX. 
Data provided by Digimap OpenStream, an EDINA, University of Edinburgh Service."; var os_options = { token: apikey, format: "image/png", layers: "osfree", cache: cache }; function init() { map = new OpenLayers.Map('map', {controls: [], projection: new OpenLayers.Projection("EPSG:27700"), units: "m", maxExtent: bounds, resolutions: [1763.889,352.778,176.389,88.194, 35.278,26.458,17.639,8.819,3.528,1.764,0.882,0.441]} ); var osfree = new OpenLayers.Layer.WMS( "Edina OS OpenData WMS","http://openstream.edina.ac.uk/openstream/wms", os_options, {attribution: attr}); map.addLayers([osfree]); map.addControl(new OpenLayers.Control.Navigation()); map.addControl(new OpenLayers.Control.PanZoomBar()); map.addControl(new OpenLayers.Control.Scale()); if (!map.getCenter()) map.zoomToMaxExtent(); } </script> <script>window.onload=init;</script> </head> <body> <div id="map" style="width:460px; height:480px;"></div> </body> </html>

Privacy & Cookie Policy