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.
Whilst this might at first seem trivial, it is actually quite complex as each OS tile has to be warped to form part of a Google tile. For MS Internet Explorer 6 and above, the demo performs the warping using MSIE's affine transformation filter. For all other browsers svg transforms are used. Results are pretty good, with the registration between the roads and buildings on the OS street maps and the Google imagery showing close correspondence in all areas of the UK. Rendering speed is quite acceptable on all mainstream browsers including MSIE.
The demo code provides a Google APIV3 Custom Map Type for OS OpenSpace tiles. There is no reason why the same approach can not be used to warp tile sets from other, non Google projection tile servers. The basic affine transform technique could also be used to provide an OS OpenSpace Custom Overlay for Google Maps. This might use less DOM nodes but would not easily support the hidden peripheral tile fetching of the Custom Map Type.
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. The coordinate conversion accuracy is 1-2m across the UK, consistent with the 1m pixels used by the most zoomed in OS mapping. Whilst the OS OpenSpace tile server uses WMS like URLs, I do not believe that it will return Google projection tiles.
I have 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. Chrome seems to be the fastest of the svg browsers and gives the best visual results (invisible joins between OS tiles).
© Bill Chadwick Dec 2010, Jan 2011