Skip to content

Commit

Permalink
Flatten 3D buildings when rendering to remove artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
petrsloup committed Aug 26, 2019
1 parent 9603703 commit aa7ae57
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/serve_rendered.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit aa7ae57

Please sign in to comment.