If I ever get time I will use the OS spreadsheet calcs to implement a full conversion.
I thought I might get a mention at the Open Tech conference since I use the bbc travel feed info but no such luck.
Here you are.
Code fix – The function calculateZoomLevel will now set the zoom level correctly to the bounding box of the dataset points. Thanks DaveP.
function calculateZoomLevel(spanLng, spanLat)
var level = _zoomLevelsX.length-1;
var found = false;
var index = 0;
while (!found && index<_zoomlevelsx .length)
if (_zoomLevelsX[index]>spanLng && _zoomLevelsY[index]>spanLat)
level = index;
found = true;
The zoomLevelsX and Y arrays hold the span values for each of the zoom levels.