From 3cc112ce6c91c0aaaf37380c80fc024cb4615329 Mon Sep 17 00:00:00 2001 From: Young Hahn Date: Mon, 30 Apr 2012 02:11:13 -0400 Subject: [PATCH] Remove putDuplicate*. --- lib/mbtiles.js | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/lib/mbtiles.js b/lib/mbtiles.js index 9a127a1..8828e28 100644 --- a/lib/mbtiles.js +++ b/lib/mbtiles.js @@ -566,31 +566,6 @@ MBTiles.prototype.putTile = function(z, x, y, data, callback) { else return callback(null); }; -// Inserts a duplicate tile into the MBTiles store. Scheme is XYZ. -// -// - @param {Number} z tile z coordinate -// - @param {Number} x tile x coordinate -// - @param {Number} y tile y coordinate -// - @param {Number} duplicate tile ID -// - @param {Function(err)} callback -MBTiles.prototype.putDuplicateTile = function(z, x, y, id, callback) { - if (typeof callback !== 'function') throw new Error('Callback needed'); - if (!this.open) return callback(new Error('MBTiles not yet loaded')); - if (!this._isWritable) return callback(new Error('MBTiles not in write mode')); - - // Flip Y coordinate because MBTiles files are TMS. - y = (1 << z) - 1 - y; - - // This corresponds to the map table. - var coords = hash(z, x, y); - if (!this._mapCache[coords]) this._mapCache[coords] = { z: z, x: x, y: y }; - this._mapCache[coords].tile_id = id; - - // Only commit when we can insert at least batchSize rows. - if (++this._pending >= this._batchSize) return this._commit(callback); - else return callback(null); -}; - // Inserts a grid into the MBTiles store. Scheme is XYZ. // // - @param {Number} z grid z coordinate @@ -642,31 +617,6 @@ MBTiles.prototype.putGrid = function(z, x, y, data, callback) { }); }; -// Inserts a duplicate grid into the MBTiles store. Scheme is XYZ. -// -// - @param {Number} z grid z coordinate -// - @param {Number} x grid x coordinate -// - @param {Number} y grid y coordinate -// - @param {Number} duplicate grid ID -// - @param {Function(err)} callback -MBTiles.prototype.putDuplicateGrid = function(z, x, y, id, callback) { - if (typeof callback !== 'function') throw new Error('Callback needed'); - if (!this.open) return callback(new Error('MBTiles not yet loaded')); - if (!this._isWritable) return callback(new Error('MBTiles not in write mode')); - - // Flip Y coordinate because MBTiles files are TMS. - y = (1 << z) - 1 - y; - - // This corresponds to the map table. - var coords = hash(z, x, y); - if (!this._mapCache[coords]) this._mapCache[coords] = { z: z, x: x, y: y }; - this._mapCache[coords].grid_id = id; - - // Only commit when we can insert at least batchSize rows. - if (++this._pending >= this._batchSize) return this._commit(callback); - else return callback(null); -}; - MBTiles.prototype.putInfo = function(data, callback) { if (typeof callback !== 'function') throw new Error('Callback needed'); if (!this.open) return callback(new Error('MBTiles not yet loaded'));