Add concept of data decorator function
This commit is contained in:
@@ -50,6 +50,10 @@ module.exports = function(options, repo, params, id, styles) {
|
||||
|
||||
Object.assign(tileJSON, params.tilejson || {});
|
||||
utils.fixTileJSONCenter(tileJSON);
|
||||
|
||||
if (options.dataDecoratorFunc) {
|
||||
tileJSON = options.dataDecoratorFunc(id, 'tilejson', tileJSON);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
@@ -114,6 +118,13 @@ module.exports = function(options, repo, params, id, styles) {
|
||||
//console.log(shrinkers[style].getStats());
|
||||
}
|
||||
}
|
||||
if (options.dataDecoratorFunc) {
|
||||
if (isGzipped) {
|
||||
data = zlib.unzipSync(data);
|
||||
isGzipped = false;
|
||||
}
|
||||
data = options.dataDecoratorFunc(id, 'data', data, z, x, y);
|
||||
}
|
||||
}
|
||||
if (format == 'pbf') {
|
||||
headers['Content-Type'] = 'application/x-protobuf';
|
||||
|
||||
Reference in New Issue
Block a user