mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-07-25 15:38:54 +00:00
unbounded unproject
This commit is contained in:
@ -22,11 +22,11 @@ L.Projection.Mercator = {
|
|||||||
return new L.Point(x, y);
|
return new L.Point(x, y);
|
||||||
},
|
},
|
||||||
|
|
||||||
unproject: function(/*Point*/ point) /*-> LatLng*/ {
|
unproject: function(/*Point*/ point, /*Boolean*/ unbounded) /*-> LatLng*/ {
|
||||||
var d = L.LatLng.DEG_TO_RAD,
|
var d = L.LatLng.DEG_TO_RAD,
|
||||||
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);
|
return new L.LatLng(lat, lng, unbounded);
|
||||||
}
|
}
|
||||||
};
|
};
|
Reference in New Issue
Block a user