mapbox / mapbox/tilelive-redis

how to implement this with mapnik

Open
#34 2 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.