[GIS] OpenLayers – How to show UK Map with OSGB Projection

openlayers-2

We are using OpenLayers for our GIS Application.

We use Google and BingVE as source for the BaseMap. We use Projection in the OpenLayers with following code. We want to show UK Map with OSGB.

if(source=='bingve')
{
    zoomlength=17-minZoomLevel;
    map=new OpenLayers.Map('map',{

        projection:new OpenLayers.Projection('EPSG:900913'),
        displayProjection:new OpenLayers.Projection('EPSG:27700'),
        units:'m'

    });
}

Does this will Automatically show Map in UK format OR we need to explicitly call Transform Method to convert Lag / Lon.

Best Answer

Required - Ordnance Survey OpenSpace API Key required.

http://trac.osgeo.org/openlayers/browser/sandbox/edgemaster/openlayers/lib/OpenLayers/Layer/OpenSpace.js?rev=6888

Bill Chadwick produced this excellent demo: SOME GOOD TIPS....

"This demo shows how map tiles on the UK OS projection (EPSG:27700) and the Google maps projection (EPSG:3857) can be composed on top of each other in most common browsers. Use the slider (click on the bars or drag the triangle) to control the opacity of the OS map."

tested the demo out in MSIE 6, MSIE 8, Firefox 3.6, Safari 5.02, Opera 10.63, Chrome 8.0.552.215 and Internet Explorer 9 beta.

http://wtp2.appspot.com/warpdemo.htm

Note: The demo code uses the WGS84 Lat/Lon to OS East/North coordinate conversion from OSGB Web Map Tools and the Ground Control Point to Affine Transfrom Matrix algorithm from Google Mapping Hacks.