diff --git a/lib/mbtiles.js b/lib/mbtiles.js index 1bfa462..41f1255 100644 --- a/lib/mbtiles.js +++ b/lib/mbtiles.js @@ -588,17 +588,17 @@ MBTiles.prototype.putGrid = function(z, x, y, data, callback) { /* this._gridCache[id] = zlib.deflate(new Buffer(json, 'utf8')); */ - + var that = this; Step(function() { zlib.deflate(new Buffer(json, 'utf8'),this); }, function(err,buffer) { if (err) return callback(err); - this._gridCache[id] = buffer; + that._gridCache[id] = buffer; // This corresponds to the grid_key table. - this._keyCache[id] = Object.keys(data.data || {}); + that._keyCache[id] = Object.keys(data.data || {}); // This corresponds to the keymap table. - _(this._dataCache).extend(data.data || {}); + _(that._dataCache).extend(data.data || {}); } ); }