Line | |
---|
1 | var 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 |
|
---|
7 | var 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.