diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index 81d2c7b0..fdcdd5ce 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -5,12 +5,7 @@ var _ = require('underscore') module.exports = function(){ var me = { base_url: '/tiles/:table', - grainstore: {datasource: global.environment.postgres, - styles: { - point: '#' + opts.table + " {marker-fill: #FF6600;marker-opacity: 1;marker-width: 8;marker-line-color: white;marker-line-width: 3;marker-line-opacity: 0.9;marker-placement: point;marker-type: ellipse;marker-allow-overlap: true;}", - polygon: '#' + opts.table + " {polygon-fill: #FF6600;polygon-opacity: 0.7;}" , - multipolygon: '#' + opts.table + " {polygon-fill: #FF6600;polygon-opacity: 0.7;}" - }}, + grainstore: {datasource: global.environment.postgres}, redis: global.environment.redis }; @@ -35,6 +30,13 @@ me.req2params = function(req, callback){ // for cartodb, ensure interactivity is cartodb_id or user specified req.params.interactivity = req.params.interactivity || 'cartodb_id'; + // configure styles + this.grainstore.styles = { + point: '#' + req.params.table + " {marker-fill: #FF6600;marker-opacity: 1;marker-width: 8;marker-line-color: white;marker-line-width: 3;marker-line-opacity: 0.9;marker-placement: point;marker-type: ellipse;marker-allow-overlap: true;}", + polygon: '#' + req.params.table + " {polygon-fill: #FF6600;polygon-opacity: 0.7;}" , + multipolygon: '#' + req.params.table + " {polygon-fill: #FF6600;polygon-opacity: 0.7;}" + }; + Step( function getDatabase(){ cartoData.getDatabase(req, this);