[OSM-dev] two javascript challenges for enthusiastic hackers

Nick Whitelegg Nick.Whitelegg at solent.ac.uk
Thu May 17 12:22:22 BST 2007

Hello Nick,

For the Mercator stuff you might want to use my pre-written class, which 
itself borrowed the conversion off OSM and some articles on the intenet 
(i.e. not really sure how the maths works - but it gives the right 


Remove the "case OSGB" blocks in the switch statements as they depend on 
another library.

To use:

var cvtr = new converter("Mercator");
var normLL = new OpenLayers.LonLat(...,...);
var merc = cvtr.normToCustom(normLL);


var cvtr = new converter("Mercator");
var mercLL = new OpenLayers.LonLat(...,...);
var normal = cvtr.customToNorm(mercLL);


More information about the dev mailing list