Closed coolaj86 closed 8 years ago
Is this the missing L?
https://searchcode.com/codesearch/view/42525008/
var L = { LatLng: {} };
L.LatLng.DEG_TO_RAD = Math.PI / 180;
L.LatLng.RAD_TO_DEG = 180 / Math.PI;
L.LatLng = function (/*Number*/ rawLat, /*Number*/ rawLng, /*Boolean*/ noWrap) {
var lat = parseFloat(rawLat),
lng = parseFloat(rawLng);
if (isNaN(lat) || isNaN(lng)) {
throw new Error('Invalid LatLng object: (' + rawLat + ', ' + rawLng + ')');
}
if (noWrap !== true) {
lat = Math.max(Math.min(lat, 90), -90); // clamp latitude into -90..90
lng = (lng + 180) % 360 + ((lng < -180 || lng === 180) ? 180 : -180); // wrap longtitude into -180..180
}
return { lat: lat, lng: lng };
};
L will be the LeafletJS Javascript map library. http://leafletjs.com/
Well... how about we just pull request that right in there then!?
...
Where does one find 'L'?
Everyone is trying to implement their Pokemon GO clients in the browser, but if I could figure out what the 'L' is wrong with this library, I could take it to the browser, where it belongs. :D
In the meantime, I'm doing this: https://github.com/Daplie/node-pokemap/issues/1