Comparing version 4.0.4 to 4.0.5
@@ -6,2 +6,3 @@ var tilelive = exports; | ||
var util = require('util'); | ||
var os = require('os'); | ||
var Queue = require('./queue'); | ||
@@ -24,5 +25,5 @@ var EventEmitter = require('events').EventEmitter; | ||
scheme: "xyz", | ||
minzoom: -1, | ||
maxzoom: -1, | ||
bounds: null, | ||
minzoom: 0, | ||
maxzoom: 22, | ||
bounds: [-180, -85.05112877980659, 180, 85.05112877980659], | ||
center: null | ||
@@ -177,12 +178,15 @@ }; | ||
if (ts.bounds[0] < -180 || ts.bounds[0] > 180) { | ||
return new Error("Tilesource's left bound is invalid: " + util.inspect(ts.bounds)); | ||
return new Error("Tilesource's west bound is invalid: " + util.inspect(ts.bounds)); | ||
} | ||
if (ts.bounds[2] < -180 || ts.bounds[2] > 180) { | ||
return new Error("Tilesource's east bound is invalid: " + util.inspect(ts.bounds)); | ||
} | ||
// @TODO these should actually be checked against | ||
// +-85.05112877980659 but some mbtiles may be using +-90 which | ||
// may not be worth failure. | ||
if (ts.bounds[1] < -90 || ts.bounds[1] > 90) { | ||
return new Error("Tilesource's bottom bound is invalid: " + util.inspect(ts.bounds)); | ||
return new Error("Tilesource's south bound is invalid: " + util.inspect(ts.bounds)); | ||
} | ||
if (ts.bounds[2] < -180 || ts.bounds[2] > 180) { | ||
return new Error("Tilesource's right bound is invalid: " + util.inspect(ts.bounds)); | ||
} | ||
if (ts.bounds[3] < -90 || ts.bounds[3] > 90) { | ||
return new Error("Tilesource's top bound is invalid: " + util.inspect(ts.bounds)); | ||
return new Error("Tilesource's north bound is invalid: " + util.inspect(ts.bounds)); | ||
} | ||
@@ -220,3 +224,3 @@ | ||
if (args.bbox[0] < -180) throw new Error('bbox has invalid west value'); | ||
if (args.bbox[1] < -85.05112877980659) throw new Error('bbox has invalid north value'); | ||
if (args.bbox[1] < -85.05112877980659) throw new Error('bbox has invalid south value'); | ||
if (args.bbox[2] > 180) throw new Error('bbox has invalid east value'); | ||
@@ -228,3 +232,3 @@ if (args.bbox[3] > 85.05112877980659) throw new Error('bbox has invalid north value'); | ||
if (typeof args.maxZoom !== 'number') throw new Error('maxZoom must be a number'); | ||
if (typeof args.concurrency !== 'number') args.concurrency = 100; | ||
if (typeof args.concurrency !== 'number') args.concurrency = os.cpus().length * 25; | ||
if (typeof callback !== 'function') callback = function() {}; | ||
@@ -279,3 +283,3 @@ | ||
if (x >= boxRight || x > bounds[z].maxX) { // Start the next row in this metatile. | ||
x = boxLeft; | ||
x = Math.max(boxLeft, bounds[z].minX); | ||
y++; | ||
@@ -287,3 +291,3 @@ } | ||
x = boxLeft; | ||
y = boxTop; | ||
y = Math.max(boxTop, bounds[z].minY); | ||
} | ||
@@ -290,0 +294,0 @@ if (x > bounds[z].maxX) { // Start the next metatile row. |
{ | ||
"name" : "tilelive", | ||
"version" : "4.0.4", | ||
"version" : "4.0.5", | ||
"main" : "./lib/tilelive.js", | ||
@@ -39,3 +39,4 @@ "description" : "Frontend for various tile backends, mapnik and mbtiles", | ||
"mbtiles": "0.1.x", | ||
"tilejson": "0.0.x" | ||
"tilejson": "0.0.x", | ||
"tilelive-mapnik": "0.2.x" | ||
}, | ||
@@ -42,0 +43,0 @@ "bin": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3672082
27
4471
6