mapbox / mapbox/tilelive-redis
how to implement this with mapnik
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 8
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
I've read the readme and been looking though the code for a few hours now, but I don't understand how to implement this with tilelive-mapnik.
Can anyone explain this a little better and update the documentation.
The code I have atm:
```
// Tile server using the node web framework Express (http://expressjs.com).
var express = require('express');
var app = express();
app.use(express.static('public'))
var tilelive = require('@mapbox/tilelive');
require('@mapbox/tilelive-mapnik').registerProtocols(tilelive);
var tileliveRedis = require('@mapbox/tilelive-redis')({}, require('@mapbox/tilejson'));
var filename = __dirname + '/' + 'test/mapnik.xml';
tilelive.load('mapnik://' + filename, function(err, source) {
if (err) throw err;
app.get('/:z/:x/:y.*', function(req, res) {
source.getTile(req.param('z'), req.param('x'), req.param('y'), function(err, tile, headers) {
// `err` is an error object when generation failed, otherwise null.
// `tile` contains the compressed image file as a Buffer
// `headers` is a hash with HTTP headers for the image.
if (!err) {
res.send(tile);
} else {
res.send('Tile rendering error: ' + err + '\n');
}
});
});
});
console.log('Listening on port: ' + 1234);
app.listen(1234);
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the README and the provided Express example, following the tilelive.load and source.getTile entry points. Clarify how tilelive-mapnik and tilelive-redis fit into this setup, including the configuration shown in the issue, and update the documentation with a complete usage explanation. Done means a newcomer can follow the documented steps to serve tiles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- express, javascript, node.js, redis
- Domain
- backend, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100