Search code examples
javascriptrubygeocodingproj4js

map geo coordinates (lat, lng) to map (x, y)


I have the geo-coordinates (latidute & longitude) of some cities and would like to get the x,y coordinates so can plot them into a map.

The map is a standart one, just like http://www.wordtravels.com/images/map/Spain/Fuerteventura_map.jpg for example.

I tried several formular I found, but none seems to really work :(. Simple javascript code or ruby would be best :)


Solution

  • in addition to the above answers, there is the open source proj4js library which performs transforms between various map projections. it is used internally by OpenLayers for this kind of thing, and supports a number of popular projections and coordinate systems.