diff --git a/include/llmr/style/properties.hpp b/include/llmr/style/properties.hpp index b4e134d65..04f1819b3 100644 --- a/include/llmr/style/properties.hpp +++ b/include/llmr/style/properties.hpp @@ -186,10 +186,14 @@ struct CompositeClass { }; struct CompositeProperties { + inline CompositeProperties() {} bool enabled = true; float opacity = 1.0; }; + +const CompositeProperties defaultCompositeProperties; + } #endif diff --git a/src/map/map.cpp b/src/map/map.cpp index 18a53be2b..d929c1adc 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -545,8 +545,8 @@ void Map::renderLayer(const LayerDescription& layer_desc, RenderPass pass) { // This is a layer group. We render them during our translucent render pass. if (pass == Translucent) { auto it = find_style(style.computed.composites, layer_desc); - if (it != style.computed.composites.end() && !is_invisible(it->second)) { - const CompositeProperties &properties = it->second; + const CompositeProperties &properties = (it != style.computed.composites.end()) ? it->second : defaultCompositeProperties; + if (!is_invisible(properties)) { gl::group group(std::string("group: ") + layer_desc.name); if (debug::renderTree) {