Pass overview-query-rewriter to mvt renderer

This commit is contained in:
Daniel García Aubert 2018-10-11 15:41:38 +02:00
parent 12dc1626a7
commit e158e3e426

View File

@ -2,10 +2,6 @@ const fqdn = require('@carto/fqdn-sync');
var _ = require('underscore'); var _ = require('underscore');
var OverviewsQueryRewriter = require('./utils/overviews_query_rewriter'); var OverviewsQueryRewriter = require('./utils/overviews_query_rewriter');
var overviewsQueryRewriter = new OverviewsQueryRewriter({
zoom_level: 'CDB_ZoomFromScale(!scale_denominator!)'
});
var rendererConfig = _.defaults(global.environment.renderer || {}, { var rendererConfig = _.defaults(global.environment.renderer || {}, {
cache_ttl: 60000, // milliseconds cache_ttl: 60000, // milliseconds
statsInterval: 60000, statsInterval: 60000,
@ -27,10 +23,17 @@ var rendererConfig = _.defaults(global.environment.renderer || {}, {
}, },
limits: {} limits: {}
}, },
http: {} http: {},
mvt: {}
}); });
rendererConfig.mapnik.queryRewriter = overviewsQueryRewriter; rendererConfig.mapnik.queryRewriter = new OverviewsQueryRewriter({
zoom_level: 'CDB_ZoomFromScale(!scale_denominator!)'
});
rendererConfig.mvt.queryRewriter = new OverviewsQueryRewriter({
zoom_level: 'CDB_ZoomFromScale(!scale_denominator!)'
});
// Perform keyword substitution in statsd // Perform keyword substitution in statsd
// See https://github.com/CartoDB/Windshaft-cartodb/issues/153 // See https://github.com/CartoDB/Windshaft-cartodb/issues/153