tilelive.list(source, callback): Lists all tilesets in a directory. source is a folder that is used by registered implementations to search for individual tilesets. callback receives an error object (or null) and a hash hash with keys being Tilestore IDs and values being Tilestore URIs. Example:
tilelive.findID(source, id, callback): Looks for a particular tileset ID in a directory. callback receives an error object (or null) and the URI of the tileset.
tilelive.load(uri, callback): Loads the Tilestore object associated with the specified uri. callback receives an error object (or null) and the Tilestore object.
tilelive.info(uri, callback): Loads the Tilestore object associated with the specified uri and retrieves its metadata in a TileJSON compliant format. callback receives an error object (or null), the metadata hash and the Tilestore object.
tilelive.all(source, callback): Loads metadata in a TileJSON compliant format for all tilesets in the directory. receives an error object (or ) and an array with TileJSON metadata about each tileset in that directory.
Read/write streams
Tilelive provides an implementation of node object streams for copying tiles from one source to another.
// Copy all tiles and metadata from source A to source B.var get = tilelive.createReadStream(sourceA);var put = tilelive.createWriteStream(sourceB);get.pipe(put);put.on('finish', function() { console.log('done!');});
See tilelive-copy and the streams tests for example usage of copy streams.
Parallel read streams
Tilelive can split a read operation into an arbitrary number of jobs. Pass a job parameter to options when using tilelive.createReadStream or tilelive.deserialize: