From 1c5fbb764bfc66b1f44059ce04e256a8443ddc92 Mon Sep 17 00:00:00 2001 From: Mateus Santos Date: Fri, 20 Jul 2018 17:23:50 -0300 Subject: [PATCH 1/3] Using the right size to calculate the tile grid used to create the snapshot --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 3b6fc14..c067f52 100644 --- a/index.js +++ b/index.js @@ -78,8 +78,8 @@ abaculus.tileList = function(z, s, center, tileSize) { var ts = Math.floor(size * s); var centerCoordinate = { - column: x / size, - row: y / size, + column: x / ts, + row: y / ts, zoom: z }; From be73f20febce45f591a1cf90663deab429c845de Mon Sep 17 00:00:00 2001 From: Mateus Santos Date: Mon, 23 Jul 2018 16:27:53 -0300 Subject: [PATCH 2/3] Changing test case to reflect this fix --- test/test.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/test.js b/test/test.js index d660694..bdf9f73 100644 --- a/test/test.js +++ b/test/test.js @@ -88,19 +88,19 @@ describe('create list of tile coordinates', function() { it('should return a tiles object with correct coords', function() { var zoom = 5, scale = 4, - width = 1824, - height = 1832, - center = { x: 4096, y: 4096, w: width, h: height }; + width = 250, + height = 250, + center = printer.coordsFromCenter(zoom, scale, { x: -47.368, y: -24.405, w: width, h: height }, limit, 256); var expectedCoords = { tiles: [ - { z: zoom, x: 15, y: 15, px: -112, py: -108 }, - { z: zoom, x: 15, y: 16, px: -112, py: 916 }, - { z: zoom, x: 16, y: 15, px: 912, py: -108 }, - { z: zoom, x: 16, y: 16, px: 912, py: 916 } + { z: zoom, x: 11, y: 17, px: -308, py: -768 }, + { z: zoom, x: 11, y: 18, px: -308, py: 256 }, + { z: zoom, x: 12, y: 17, px: 716, py: -768 }, + { z: zoom, x: 12, y: 18, px: 716, py: 256 } ], - dimensions: { x: width, y: height }, - center: { row: 16, column: 16, zoom: zoom }, + dimensions: { x: Math.round(width*scale), y: Math.round(height*scale) }, + center: { row: 18, column: 11, zoom: zoom }, scale: scale }; var coords = printer.tileList(zoom, scale, center); From 9b28ad536328eeca5df4bffca80f94ca94f50367 Mon Sep 17 00:00:00 2001 From: Mateus Santos Date: Thu, 9 Aug 2018 06:48:25 -0700 Subject: [PATCH 3/3] Fixing tile size calculation in v3.0.1 Also, changing the namespace to kartotherian after unresponsive time from the upstream --- changelog.md | 5 +++++ package.json | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 905a5cb..e356dfe 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # CHANGELOG +# v3.0.1 + +* Publishing under kartotherian namespace +* Fixing tile size calculation for scales greater then 1 + # v3.0.0 * Updates to mapnik 3.7.0 diff --git a/package.json b/package.json index 1d7b606..5461721 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@mapbox/abaculus", - "version": "3.0.0", + "name": "@kartotherian/abaculus", + "version": "3.0.1", "description": "stitches map tiles together for high-res exporting from tm2", "main": "index.js", "contributors": [