Use readFileSync to avoid errors on low ulimit setups.
This commit is contained in:
@@ -30,9 +30,7 @@ exports['test mbtiles file creation'] = function(beforeExit) {
|
|||||||
// Flip Y coordinate because file names are TMS, but .putGrid() expects XYZ.
|
// Flip Y coordinate because file names are TMS, but .putGrid() expects XYZ.
|
||||||
coords[2] = Math.pow(2, coords[3]) - 1 - coords[2];
|
coords[2] = Math.pow(2, coords[3]) - 1 - coords[2];
|
||||||
|
|
||||||
fs.readFile(__dirname + '/fixtures/grids/' + file, 'utf8', function(err, grid) {
|
var grid = fs.readFileSync(__dirname + '/fixtures/grids/' + file, 'utf8');
|
||||||
if (err) throw err;
|
|
||||||
|
|
||||||
mbtiles.putGrid(coords[3] | 0, coords[1] | 0, coords[2] | 0, JSON.parse(grid), function(err) {
|
mbtiles.putGrid(coords[3] | 0, coords[1] | 0, coords[2] | 0, JSON.parse(grid), function(err) {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
completed.written++;
|
completed.written++;
|
||||||
@@ -44,7 +42,6 @@ exports['test mbtiles file creation'] = function(beforeExit) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function verifyWritten() {
|
function verifyWritten() {
|
||||||
|
|||||||
Reference in New Issue
Block a user