diff --git a/src/map/map.cpp b/src/map/map.cpp index e640ec68a..4b4e58d14 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -646,7 +646,7 @@ void Map::renderLayer(std::shared_ptr layer_desc, RenderPass pass) { } } } - } else if (layer_desc->id == "background") { + } else if (layer_desc->type == StyleLayerType::Background) { // This layer defines the background color. } else { // This is a singular layer. diff --git a/src/style/style.cpp b/src/style/style.cpp index 76ee3707b..03881f96a 100644 --- a/src/style/style.cpp +++ b/src/style/style.cpp @@ -98,7 +98,7 @@ void Style::loadJSON(const uint8_t *const data) { const BackgroundProperties &Style::getBackgroundProperties() const { if (layers && layers->layers.size()) { const auto first = layers->layers.front(); - if (first && first->id == "background") { + if (first && first->type == StyleLayerType::Background) { return first->getProperties(); } } diff --git a/src/style/style_layer.cpp b/src/style/style_layer.cpp index 3d5ffd6a4..1672ad4a8 100644 --- a/src/style/style_layer.cpp +++ b/src/style/style_layer.cpp @@ -10,7 +10,7 @@ StyleLayer::StyleLayer(const std::string &id, std::map : id(id), styles(std::move(styles)), rasterize(std::move(rasterize)) {} bool StyleLayer::isBackground() const { - return type == StyleLayerType::Background && id == "background"; + return type == StyleLayerType::Background; } void StyleLayer::setClasses(const std::vector &class_names, const timestamp now,