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

Nick Whitelegg nick at hogweed.org
Sat Jan 5 10:04:45 GMT 2008


Hello everyone,

Freemap has been Mercator for a while now, but has used its own zoom levels 
rather than the standard Google zoom levels. By using code from 
informationfreeway.org, I have now converted Freemap to use the Google zoom 
levels and tiling scheme, but I'm now getting a mismatch in the Mercator 
coordinates used compared to previously.

Previously, the mercator coordinates (-85000, 6595000) corresponded to 
Fernhurst, West sussex, UK but (as you can see at http://www.free-map.org.uk) 
they now correspond to Lavant, some 15 miles south.

The code I previously used to convert from latlon to mercator is a standard 
algorithm found on the web and is at

http://www.free-map.org.uk/freemap/javascript/lib/converter.js
(look in the Mercator section)

The OpenLayers code I now use to set up the map is the same as that in 
informationfreeway.org, and can be found at

http://www.free-map.org.uk/freemap/javascript/mapnik/init.js

The markers overlays are using the old code, so the markers you see *are* the 
Fernhurst area ones.

Any ideas what might have gone wrong?

Thanks,
Nick




More information about the dev mailing list