From d02632b3a2a4466c50f338f441065e996af602fa Mon Sep 17 00:00:00 2001 From: Young Hahn Date: Wed, 1 Feb 2012 15:39:26 -0500 Subject: [PATCH] Use passed id in putGrid. --- lib/mbtiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mbtiles.js b/lib/mbtiles.js index d821488..9b77a0e 100644 --- a/lib/mbtiles.js +++ b/lib/mbtiles.js @@ -566,7 +566,7 @@ MBTiles.prototype.putGrid = function(z, x, y, data, callback) { // Preprocess grid data. var json = JSON.stringify({ grid: data.grid, keys: data.keys }); - var id = crypto.createHash('md5').update(json).digest('hex'); + var id = data.id || crypto.createHash('md5').update(json).digest('hex'); if (!this._gridCache[id]) { // This corresponds to the grid_utfgrid table. this._gridCache[id] = zlib.deflate(new Buffer(json, 'utf8'));