Use passed id in putGrid.

This commit is contained in:
Young Hahn
2012-02-01 15:39:26 -05:00
parent 2e4bc80217
commit d02632b3a2

View File

@@ -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'));