2018-10-24 00:39:02 +08:00
|
|
|
'use strict';
|
|
|
|
|
2015-07-08 05:46:58 +08:00
|
|
|
var _ = require('underscore');
|
2019-10-07 16:10:51 +08:00
|
|
|
var serverOptions = require('../../../../lib/server-options');
|
2020-04-04 23:34:22 +08:00
|
|
|
const mapnik = require('@carto/mapnik');
|
2019-10-07 16:06:01 +08:00
|
|
|
var OverviewsQueryRewriter = require('../../../../lib/utils/overviews-query-rewriter');
|
2016-02-04 17:26:31 +08:00
|
|
|
var overviewsQueryRewriter = new OverviewsQueryRewriter({
|
2019-10-22 01:07:24 +08:00
|
|
|
zoom_level: 'CDB_ZoomFromScale(!scale_denominator!)'
|
2016-02-04 17:26:31 +08:00
|
|
|
});
|
2019-10-23 00:22:33 +08:00
|
|
|
var path = require('path');
|
2015-07-08 05:46:58 +08:00
|
|
|
|
|
|
|
module.exports = _.extend({}, serverOptions, {
|
|
|
|
grainstore: {
|
|
|
|
datasource: {
|
|
|
|
geometry_field: 'the_geom',
|
|
|
|
srid: 4326
|
|
|
|
},
|
|
|
|
cachedir: global.environment.millstone.cache_basedir,
|
|
|
|
mapnik_version: global.environment.mapnik_version || mapnik.versions.mapnik,
|
2019-11-14 20:14:31 +08:00
|
|
|
gc_prob: 0, // run the garbage collector at each invocation
|
|
|
|
default_layergroup_ttl: global.environment.mapConfigTTL || 7200
|
2015-07-08 05:46:58 +08:00
|
|
|
},
|
|
|
|
renderer: {
|
|
|
|
mapnik: {
|
2019-10-22 01:07:24 +08:00
|
|
|
poolSize: 4, // require('os').cpus().length,
|
2019-07-30 01:14:27 +08:00
|
|
|
poolMaxWaitingClients: 32,
|
2015-07-08 05:46:58 +08:00
|
|
|
metatile: 1,
|
|
|
|
bufferSize: 64,
|
|
|
|
snapToGrid: false,
|
|
|
|
clipByBox2d: false, // this requires postgis >=2.2 and geos >=3.5
|
|
|
|
scale_factors: [1, 2],
|
2018-01-16 17:23:46 +08:00
|
|
|
metrics: false,
|
2015-07-08 05:46:58 +08:00
|
|
|
limits: {
|
|
|
|
render: 0,
|
|
|
|
cacheOnTimeout: true
|
2016-02-04 17:26:31 +08:00
|
|
|
},
|
|
|
|
queryRewriter: overviewsQueryRewriter
|
2015-07-08 05:46:58 +08:00
|
|
|
},
|
|
|
|
http: {
|
|
|
|
timeout: 5000,
|
|
|
|
whitelist: ['http://127.0.0.1:8033/{s}/{z}/{x}/{y}.png'],
|
|
|
|
fallbackImage: {
|
|
|
|
type: 'fs',
|
2020-03-19 02:45:31 +08:00
|
|
|
src: path.join(__dirname, '/../../../fixtures/http/basemap.png')
|
2015-07-08 05:46:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
redis: global.environment.redis,
|
|
|
|
enable_cors: global.environment.enable_cors,
|
|
|
|
unbuffered_logging: true, // for smoother teardown from tests
|
|
|
|
log_format: null, // do not log anything
|
2018-03-17 03:04:39 +08:00
|
|
|
useProfiler: true
|
2015-07-08 05:46:58 +08:00
|
|
|
});
|