tiny mercator refactoring

This commit is contained in:
Mourner 2011-03-28 15:56:20 +03:00
parent f61720c2d7
commit c6e878a997

View File

@ -23,9 +23,9 @@ L.Projection.Mercator = {
},
unproject: function(/*Point*/ point, /*Boolean*/ unbounded) /*-> LatLng*/ {
var d = L.LatLng.DEG_TO_RAD,
lng = point.x / d,
lat = (2 * Math.atan(Math.exp(point.y)) - Math.PI/2) / d;
var d = L.LatLng.RAD_TO_DEG,
lng = point.x * d,
lat = (2 * Math.atan(Math.exp(point.y)) - Math.PI/2) * d;
return new L.LatLng(lat, lng, unbounded);
}