forked from 0x2620/oxjs
minor cleanup
This commit is contained in:
parent
b1ff236b3f
commit
e47f826329
4 changed files with 15 additions and 18 deletions
|
|
@ -145,12 +145,12 @@
|
|||
{lat: 0, lng: 0}
|
||||
@*/
|
||||
Ox.getLatLngByXY = function(xy) {
|
||||
function getVal(val) {
|
||||
return (val - 0.5) * 2 * Math.PI;
|
||||
function getValue(value) {
|
||||
return (value - 0.5) * 2 * Math.PI;
|
||||
}
|
||||
return {
|
||||
lat: -Ox.deg(Math.atan(Ox.sinh(getVal(xy.y)))),
|
||||
lng: Ox.deg(getVal(xy.x))
|
||||
lat: -Ox.deg(Math.atan(Ox.sinh(getValue(xy.y)))),
|
||||
lng: Ox.deg(getValue(xy.x))
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -213,12 +213,12 @@
|
|||
{x: 0.5, y: 0.5}
|
||||
@*/
|
||||
Ox.getXYByLatLng = function(latlng) {
|
||||
function getVal(val) {
|
||||
return (val / (2 * Math.PI) + 0.5)
|
||||
function getValue(value) {
|
||||
return (value / (2 * Math.PI) + 0.5);
|
||||
}
|
||||
return {
|
||||
x: getVal(Ox.rad(latlng.lng)),
|
||||
y: getVal(Ox.asinh(Math.tan(Ox.rad(-latlng.lat))))
|
||||
x: getValue(Ox.rad(latlng.lng)),
|
||||
y: getValue(Ox.asinh(Math.tan(Ox.rad(-latlng.lat))))
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue