Comparing version 4.0.0 to 4.0.1
16
API.md
@@ -88,6 +88,18 @@ ```javascript | ||
```javascript | ||
Tilesink.prototype.putInfo = function(info, callback) { | ||
// Stores metadata into the tilesink. Info is a key-value hash with metadata. | ||
// Implementations may decide to reject invalid keys. | ||
function callback(err) { | ||
// err is null when the metadata could be written successfully. | ||
// err is an Error object otherwise. | ||
} | ||
}; | ||
``` | ||
```javascript | ||
Tilesink.prototype.putTile = function(z, x, y, tile, callback) { | ||
// Stores a tile into the data store. Parameters are in XYZ format. | ||
// `tile` must be a Buffer containing the compressed image. | ||
function callback(err) { | ||
@@ -98,3 +110,3 @@ // err is null when the write request was received successfully. | ||
} | ||
// Implementations may decide to cache multiple tile requests and only | ||
@@ -101,0 +113,0 @@ // commit them to the data store periodically to improve performance. |
@@ -225,4 +225,4 @@ var tilelive = exports; | ||
tilelive.copy = function(args, callback) { | ||
if (typeof args.source.getTile !== 'function') throw new Error('source must be a tileargs.source'); | ||
if (typeof args.source.putTile !== 'function') throw new Error('sink must be a tileargs.sink'); | ||
if (typeof args.source.getTile !== 'function') throw new Error('source must implement the tilesource interface'); | ||
if (typeof args.sink.putTile !== 'function') throw new Error('sink must implement the tilesink interface'); | ||
if (!Array.isArray(args.bbox) || args.bbox.length !== 4) throw new Error('bbox must have four lat/long coordinates'); | ||
@@ -284,3 +284,3 @@ if (typeof args.minZoom !== 'number') throw new Error('minZoom must be a number'); | ||
var get = type === 'grid' ? 'getGrid' : 'getTile'; | ||
var put = type === 'grid' ? 'putGrid' : 'putGrid'; | ||
var put = type === 'grid' ? 'putGrid' : 'putTile'; | ||
args.source[get](z, x, y, function(err, data) { | ||
@@ -287,0 +287,0 @@ if (err) { |
{ | ||
"name" : "tilelive", | ||
"version" : "4.0.0", | ||
"version" : "4.0.1", | ||
"main" : "./lib/tilelive.js", | ||
@@ -42,3 +42,3 @@ "description" : "Frontend for various tile backends, mapnik and mbtiles", | ||
"bin": { | ||
"tilebatch": "./bin/tilebatch" | ||
"tilelive": "./bin/tilelive" | ||
}, | ||
@@ -45,0 +45,0 @@ "engines": { |
@@ -99,2 +99,8 @@ var assert = require('assert'); | ||
if (err) throw err; | ||
// Sort tilesets before deepEqual. | ||
info.sort(function(a, b) { | ||
return (a.basename || '0') < (b.basename || '0') ? -1 : 1; | ||
}); | ||
assert.deepEqual(info, [{ | ||
@@ -126,3 +132,3 @@ name: 'MapQuest Open', | ||
scheme: 'tms', | ||
size: 561152 | ||
filesize: 561152 | ||
}, { | ||
@@ -142,3 +148,3 @@ basename: 'plain_2.mbtiles', | ||
scheme: 'tms', | ||
size: 874496, | ||
filesize: 874496, | ||
}, { | ||
@@ -158,3 +164,3 @@ basename: 'plain_4.mbtiles', | ||
scheme: 'tms', | ||
size: 684032 | ||
filesize: 684032 | ||
}]); | ||
@@ -161,0 +167,0 @@ }); |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4436
8
3652983
26