UNPKG
kea-geo
Version:
latest (0.0.12)
0.0.12
0.0.11
0.0.10
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
Collection of geo related utility
github.com/ardhi/kea-geo
ardhi/kea-geo
kea-geo
/
src
/
lngToTile.js
6 lines
(4 loc)
•
228 B
JavaScript
View Raw
1
2
3
4
5
6
// source: https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#ECMAScript_.28JavaScript.2FActionScript.2C_etc..29
module
.
exports
=
function
(
lng, zoom
) {
return
(
Math
.
floor
((lng +
180
) /
360
*
Math
.
pow
(
2
, zoom))) }