Comparing version 4.0.1 to 4.0.2
@@ -230,3 +230,2 @@ var tilelive = exports; | ||
if (typeof args.maxZoom !== 'number') throw new Error('maxZoom must be a number'); | ||
if (typeof args.concurrency === 'function') { callback = args.concurrency; args.concurrency = undefined; } | ||
if (typeof args.concurrency !== 'number') args.concurrency = 100; | ||
@@ -268,14 +267,50 @@ if (typeof callback !== 'function') callback = function() {}; | ||
function id() { | ||
if (z > args.maxZoom) return false; | ||
if (++x > bounds[z].maxX) { | ||
x = bounds[z].minX; | ||
y++; | ||
if (args.source.metatile > 1) { | ||
var boxSize = args.source.metatile, boxLeft, boxTop, boxLeft, boxBottom; | ||
var resetID = function() { | ||
boxLeft = x - x % boxSize; | ||
boxRight = boxLeft + boxSize; | ||
boxTop = y - y % boxSize; | ||
boxBottom = boxTop + boxSize; | ||
} | ||
if (y > bounds[z].maxY) { | ||
if (++z > args.maxZoom) return false; | ||
x = bounds[z].minX; | ||
y = bounds[z].minY; | ||
} | ||
return true; | ||
resetID(); // Initialize. | ||
var id = function() { | ||
++x; | ||
if (x >= boxRight || x > bounds[z].maxX) { // Start the next row in this metatile. | ||
x = boxLeft; | ||
y++; | ||
} | ||
if (y >= boxBottom || y > bounds[z].maxY) { // Start the next metatile in this row. | ||
boxLeft += boxSize; | ||
boxRight = boxLeft + boxSize; | ||
x = boxLeft; | ||
y = boxTop; | ||
} | ||
if (x > bounds[z].maxX) { // Start the next metatile row. | ||
x = bounds[z].minX; | ||
y = boxBottom; | ||
resetID(); | ||
} | ||
if (y > bounds[z].maxY) { // All rows in this zoom level are exhausted. | ||
if (++z > args.maxZoom) return false; | ||
x = bounds[z].minX; | ||
y = bounds[z].minY; | ||
resetID(); | ||
} | ||
return true; | ||
}; | ||
} else { | ||
var id = function() { | ||
if (++x > bounds[z].maxX) { | ||
x = bounds[z].minX; | ||
y++; | ||
} | ||
if (y > bounds[z].maxY) { | ||
if (++z > args.maxZoom) return false; | ||
x = bounds[z].minX; | ||
y = bounds[z].minY; | ||
} | ||
return true; | ||
}; | ||
} | ||
@@ -282,0 +317,0 @@ |
{ | ||
"name" : "tilelive", | ||
"version" : "4.0.1", | ||
"version" : "4.0.2", | ||
"main" : "./lib/tilelive.js", | ||
@@ -5,0 +5,0 @@ "description" : "Frontend for various tile backends, mapnik and mbtiles", |
Sorry, the diff of this file is not supported yet
3654186
4470