tiny mercator refactoring
This commit is contained in:
parent
f61720c2d7
commit
c6e878a997
@ -23,9 +23,9 @@ L.Projection.Mercator = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
unproject: function(/*Point*/ point, /*Boolean*/ unbounded) /*-> LatLng*/ {
|
unproject: function(/*Point*/ point, /*Boolean*/ unbounded) /*-> LatLng*/ {
|
||||||
var d = L.LatLng.DEG_TO_RAD,
|
var d = L.LatLng.RAD_TO_DEG,
|
||||||
lng = point.x / d,
|
lng = point.x * d,
|
||||||
lat = (2 * Math.atan(Math.exp(point.y)) - Math.PI/2) / d;
|
lat = (2 * Math.atan(Math.exp(point.y)) - Math.PI/2) * d;
|
||||||
|
|
||||||
return new L.LatLng(lat, lng, unbounded);
|
return new L.LatLng(lat, lng, unbounded);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user