[OSM-dev] Mercator coordinates mismatch (informationfreeway.org and Freemap)

Nick Whitelegg nick at hogweed.org
Sat Jan 5 13:07:59 GMT 2008


>
> That code looks like it is assuming a non-sperical earth (which is
> correct but not what the Google-like tiling scheme assumes). The
> values for a and b look like the diameter of the earth along each
> axis and are different.
>
> You will need to use a spherical mercator calculation I suspect
> which assumes the earth has the same diameter in all directions.
>
> The code we use on the main OSM site can be seen at:
>
> http://trac.openstreetmap.org/browser/sites/rails_port/public/javascripts/m
>ap.js
>
> Tom

Hello Tom,

Thanks for that. It turned out that way back when ,  when I was first playing 
around with this stuff, I'd already implemented this (possibly from the main 
OSM site) in the converter.js under the "Google" section.... so now the 
markers are overlaid on the map correctly.

Nick




More information about the dev mailing list