source: binary-improvements/webserver/js/util.js@ 299

Last change on this file since 299 was 245, checked in by alloc, 9 years ago

Fixes

File size: 539 bytes
Line 
1var CoordToChunk = function(latlng) {
2 var x = Math.floor(((latlng.lat + 16777216) / mapinfo.chunksize) - (16777216 / mapinfo.chunksize));
3 var y = Math.floor(((latlng.lng + 16777216) / mapinfo.chunksize) - (16777216 / mapinfo.chunksize));
4 return L.latLng(x, y);
5}
6
7var CoordToRegion = function(latlng) {
8 var x = Math.floor(((latlng.lat + 16777216) / mapinfo.regionsize) - (16777216 / mapinfo.regionsize));
9 var y = Math.floor(((latlng.lng + 16777216) / mapinfo.regionsize) - (16777216 / mapinfo.regionsize));
10 return L.latLng(x, y);
11}
12
Note: See TracBrowser for help on using the repository browser.