Merge branch 'master' of github.com:mapbox/node-mbtiles
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
test/fixtures/non_existent.mbtiles
|
||||
@@ -240,8 +240,8 @@ MBTiles.prototype.grid = function(x, y, z, callback) {
|
||||
);
|
||||
},
|
||||
function(err, row, rows) {
|
||||
if ((!row || !row.grid) || (err && err.errno == 1)) return callback('Grid does not exist');
|
||||
if (err) return callback(err);
|
||||
if (!row || !row.grid) return callback('Grid does not exist');
|
||||
|
||||
try {
|
||||
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);
|
||||
return memo;
|
||||
}, {});
|
||||
callback(null, _(JSON.parse(grid)).extend({ data: data }));
|
||||
} catch (err) {
|
||||
callback('Grid is invalid');
|
||||
return callback('Grid is invalid');
|
||||
}
|
||||
|
||||
callback(null, _(JSON.parse(grid)).extend({ data: data }));
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
BIN
test/fixtures/plain_1.mbtiles
vendored
BIN
test/fixtures/plain_1.mbtiles
vendored
Binary file not shown.
Reference in New Issue
Block a user