tile-to-geo
v1.0.2
Published
Transform tile x,y to lat,lng and back for spherical mercator.
Downloads
5
Maintainers
Readme
tile-to-geo
Transform lat,zoom and lng,zoom to tile coordinates and back for spherical mercator projection.
Install
npm install tile-to-geo
Usage
assert(tu.lng_x(45, 1), 1);
assert(tu.lat_y(-45, 1), 1);
assert(tu.lng_x(160, 2), 3);
assert(tu.lat_y(-80, 2), 3);
assert(tu.x_lng(0, 2), -180);
assert(tu.y_lat(0, 2), 90);
assert(tu.x_lng(4, 2), 180);
assert(tu.y_lat(4, 2), -90);
Tests
npm test