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*/ {
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user