pin to mapnik 2.0, enable passing style via url

This commit is contained in:
Simon Tokumine 2011-12-09 00:32:32 +00:00
parent 5fbd3a376e
commit 78d415569d
3 changed files with 5 additions and 6 deletions

View File

@ -2,16 +2,15 @@
var _ = require('underscore')
, Step = require('step')
, Windshaft = require('windshaft')
, Cache = require('./cache_validator')
, Cache = require('./cache_validator');
var CartodbWindshaft = function(serverOptions) {
// set the cache chanel info to invalidate the cache on the frontend server
serverOptions.afterTileRender = function(req, res, tile, headers, callback) {
res.header('X-Cache-Channel', req.params.dbname);
// note - may not be invalidating properly
res.header('Last-Modified', new Date().toUTCString());
res.header('Cache-Control', 'no-cache,max-age=3600,must-revalidate, public');
res.header('Cache-Control', 'no-cache,max-age=86400,must-revalidate, public');
callback(null, tile, headers);
};

View File

@ -22,7 +22,7 @@ module.exports = function(){
me.req2params = function(req, callback){
// Whitelist query parameters and attach format
var good_query = ['sql', 'geom_type', 'cache_buster','callback', 'interactivity', 'map_key'];
var good_query = ['sql', 'geom_type', 'cache_buster','callback', 'interactivity', 'map_key', 'style'];
var bad_query = _.difference(_.keys(req.query), good_query);
_.each(bad_query, function(key){ delete req.query[key]; });

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "windshaft-cartodb",
"version": "0.0.1",
"version": "0.1.0",
"description": "A map tile server for CartoDB",
"url": "https://github.com/Vizzuality/Windshaft-cartodb",
"licenses": [{ "type": "Copyright Vizzuality" }],
@ -16,7 +16,7 @@
},
"dependencies": {
"underscore" : "1.1.x",
"windshaft" : "0.3.2",
"windshaft" : "0.4.1",
"step": "0.0.x",
"generic-pool": "1.0.x",
"redis": "0.6.7",