I found this page:
http://www.provide.net/~bratliff/adjust.js
In another post about getting tile coordinates.
I have converted my coordinates using these slightly modified versions
functions:
---
var m=57.295779513082320876798154814114;
function lng2x(x)
{
return m*(x*Math.PI/180);
}
function lat2y(y)
{
return m*(Math.log((1+Math.sin(y*Math.PI/180))/(1-
Math.sin(y*Math.PI/180)))/2);
}
---
Now my lat/lng is evenly spaced from 180 to -180, but I need to
convert them back to be usable. No biggie, there are also 2 functions
for that right?
---
var m=57.295779513082320876798154814114;
function x2lng(x)
{
return (x*180/Math.PI)/m;
}
function y2lat(y)
{
return ((Math.PI/2-2*Math.atan(Math.exp(y)))*180/
Math.PI)/m;
}
---
Well x2lng seems to work, but y2lat only returns 90 no matter what
what. Math is my weakness, and I hope someone here can tell me what's
wrong.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---