npm install tilelive-mapnikRenderer backend for tilelive.js that
uses node-mapnik to render tiles and
grids from a Mapnik XML file. tilelive-mapnik implements the
Tilesource API.


npm install tilelive-mapnik
Though tilelive is not a dependency of tilelive-mapnik you will want to
install it to actually make use of tilelive-mapnik through a reasonable
API.
``javascript
var tilelive = require('tilelive');
require('tilelive-mapnik').registerProtocols(tilelive);
tilelive.load('mapnik:///path/to/file.xml', function(err, source) {
if (err) throw err;
// Interface is in XYZ/Google coordinates.
// Use y = (1 << z) - 1 - y to flip TMS coordinates.err
source.getTile(0, 0, 0, function(err, tile, headers) {
// is an error object when generation failed, otherwise null.tile
// contains the compressed image file as a Bufferheaders
// is a hash with HTTP headers for the image.
});
// The .getGrid is implemented accordingly.`
});
Note that grid generation will only work when there's metadata inside a object in the Mapnik XML.
The key fields are interactivity_layer and interactivity_fields. See anParameters` are normally added by the application that creates the XML,
example in the tests. These
in this case CartoCSS