From a8485643e05325160a2f75977f5c09752f8b628b Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Sun, 24 Feb 2019 19:23:00 +0000 Subject: [PATCH] Add xyz method to tile --- app/src/tiles/tile.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/app/src/tiles/tile.js b/app/src/tiles/tile.js index d2655e5c..ea41aa12 100644 --- a/app/src/tiles/tile.js +++ b/app/src/tiles/tile.js @@ -129,14 +129,12 @@ const mercator = new SphericalMercator({ size: TILE_SIZE }); -function get_bbox(int_z, int_x, int_y){ - return mercator.bbox( - int_x, - int_y, - int_z, - false, - '900913' - ); +function get_bbox(z, x, y){ + return mercator.bbox(x, y, z, false, '900913'); +} + +function get_xyz(bbox, z){ + return mercator.xyz(bbox, z, false, '900913') } function render_tile(tileset, z, x, y, geometry_id, cb){ @@ -191,4 +189,4 @@ function get_highlight_table_def(geometry_id) { } -export { get_bbox, render_tile }; +export { get_bbox, get_xyz, render_tile };