In Javascript.
I have a map of the world that is 1024 x 1024px – It is a spherical Mercator projection.
Im looking to convert long/lat to x,y for this map. I have a bunch of coordinates that I need to overlay on top of it.
Calculating longitude was very easy, and I am doing it like so:
pos.x = ((long + 180)/ 360) * 1024;
I just need to same for lat –> y
I looked around a saw a lot of reference to openlayers, but didn’t see such a conversion.
To boil it down:
Lat and long must be expressed in radians of course.