Comparing version 5.6.1 to 5.6.2
@@ -13,2 +13,3 @@ var sm = new (require('sphericalmercator'))(); | ||
var util = require('util'); | ||
var validate = require('./tilelive.js').validate; | ||
@@ -68,5 +69,8 @@ module.exports = Pyramid; | ||
stream.bboxes = {}; | ||
var bounds = limitBounds(stream.bounds); | ||
var boundsArray = limitBounds(stream.bounds); | ||
var valid = validate({bounds:boundsArray}); | ||
if (valid instanceof Error) return stream.emit('error', new Error(valid.message)); | ||
for (var z = stream.minzoom; z <= stream.maxzoom; z++) { | ||
stream.bboxes[z] = sm.xyz(bounds, z); | ||
stream.bboxes[z] = sm.xyz(boundsArray, z); | ||
stream.stats.total += | ||
@@ -73,0 +77,0 @@ (stream.bboxes[z].maxX - stream.bboxes[z].minX + 1) * |
@@ -11,2 +11,3 @@ var sm = new (require('sphericalmercator'))(); | ||
var util = require('util'); | ||
var validate = require('./tilelive.js').validate; | ||
@@ -56,5 +57,8 @@ module.exports = Scanline; | ||
stream.bboxes = {}; | ||
var bounds = limitBounds(stream.bounds); | ||
var boundsArray = limitBounds(stream.bounds); | ||
var valid = validate({bounds:boundsArray}); | ||
if (valid instanceof Error) return stream.emit('error', new Error(valid.message)); | ||
for (var z = stream.minzoom; z <= stream.maxzoom; z++) { | ||
stream.bboxes[z] = sm.xyz(bounds, z); | ||
stream.bboxes[z] = sm.xyz(boundsArray, z); | ||
stream.stats.total += | ||
@@ -61,0 +65,0 @@ (stream.bboxes[z].maxX - stream.bboxes[z].minX + 1) * |
@@ -183,2 +183,3 @@ var tilelive = exports; | ||
function isNumber(v) { return typeof v === 'number'; } | ||
function validExtent(n) { return !isNaN(parseFloat(n)) && isFinite(n); } | ||
for (var key in info) { | ||
@@ -236,3 +237,3 @@ var val = info[key]; | ||
case 'bounds': | ||
if (!Array.isArray(val) || val.length !== 4 || !val.every(isNumber)) | ||
if (!Array.isArray(val) || val.length !== 4 || !val.every(validExtent)) | ||
return new Error('bounds must be an array of the form [west, south, east, north]'); | ||
@@ -239,0 +240,0 @@ if (val[0] < -360 || val[0] > 360) |
{ | ||
"name": "tilelive", | ||
"version": "5.6.1", | ||
"version": "5.6.2", | ||
"main": "./lib/tilelive.js", | ||
@@ -5,0 +5,0 @@ "description": "API for various map tile backends", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
62857
1122
1