Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
18 changes: 9 additions & 9 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down