Merge branch 'master' of github.com:mapbox/node-mbtiles
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
test/fixtures/non_existent.mbtiles
|
||||||
+4
-3
@@ -240,8 +240,8 @@ MBTiles.prototype.grid = function(x, y, z, callback) {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
function(err, row, rows) {
|
function(err, row, rows) {
|
||||||
|
if ((!row || !row.grid) || (err && err.errno == 1)) return callback('Grid does not exist');
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
if (!row || !row.grid) return callback('Grid does not exist');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var grid = zlib.inflate(
|
var grid = zlib.inflate(
|
||||||
@@ -253,10 +253,11 @@ MBTiles.prototype.grid = function(x, y, z, callback) {
|
|||||||
memo[r.key_name] = JSON.parse(r.key_json);
|
memo[r.key_name] = JSON.parse(r.key_json);
|
||||||
return memo;
|
return memo;
|
||||||
}, {});
|
}, {});
|
||||||
callback(null, _(JSON.parse(grid)).extend({ data: data }));
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
callback('Grid is invalid');
|
return callback('Grid is invalid');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
callback(null, _(JSON.parse(grid)).extend({ data: data }));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user