chelm/mbtiles-server — pull request #4 by tobinbradley (2013-06-26 00:05:37+00:00)
Title: getTile argument order

Thanks for this - it was exactly what I was looking for! One thing I had a problem with is the argument order for getTile. You have it as y,x,z, but the mbtiles.prototype.getTile spec has it as z,x,y. Since Leaflet uses the same alpha names for its layer parameters, it threw me for a bit. I could always remap the order in the client request, but since they use the same letters (i.e. `http://localhost:3000/{y}/{x}/{z}.png`) it feels dirty.

Not a big deal, just thought I'd let you know.

Incidentally, any idea if there would be a problem tacking on a mbtiles name in the url route in case you have more than one tile set, like:

```
var express = require("express"),
app = express(),
MBTiles = require('mbtiles');

app.get('/:s/:y/:x/:z.*', function(req, res) {
new MBTiles(__dirname + '\\' + req.param('s') + '.mbtiles', function(err, mbtiles) {
mbtiles.getTile(req.param('z'), req.param('x'), req.param('y'), function(err, tile, headers) {
if (err) {
res.send('Tile rendering error: ' + err + '\n');
} else {
res.header("Content-Type", "image/png");
res.send(tile);
}
});
if (err) console.log("error");
});
});

console.log('Listening on port: ' + 3000);
app.listen(3000);
```

Seems to work fine, but I don't know if I'm losing some performance shiny by having more than one .mbtiles db per listener (wouldn't think so being node and all, but I'm a node noob).