Flatten 3D buildings when rendering to remove artifacts

This commit is contained in:
Petr Sloup 2019-08-26 12:10:49 +02:00
parent 9603703908
commit aa7ae575d0

View file

@ -263,6 +263,18 @@ module.exports = function(options, repo, params, id, publicUrl, dataResolver) {
styleJSON.glyphs = 'fonts://' + styleJSON.glyphs;
}
(styleJSON.layers || []).forEach(function(layer) {
if (layer && layer.paint) {
// Remove (flatten) 3D buildings
if (layer.paint['fill-extrusion-height']) {
layer.paint['fill-extrusion-height'] = 0;
}
if (layer.paint['fill-extrusion-base']) {
layer.paint['fill-extrusion-base'] = 0;
}
}
});
var tileJSON = {
'tilejson': '2.0.0',
'name': styleJSON.name,