summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-08-05 11:58:16 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-08-05 11:58:16 +0200
commitb402d03837d96b0d62ff9b44da64b7d9ff32917b (patch)
tree4d8d3498cb2bfc2ca89c058306203c938de234b9 /src
parent17617a54bdcd2c51f7b28cbde18655a2e62f63e3 (diff)
downloadqtlocation-mapboxgl-b402d03837d96b0d62ff9b44da64b7d9ff32917b.tar.gz
don't require the background layer to be named "background"
Diffstat (limited to 'src')
-rw-r--r--src/map/map.cpp2
-rw-r--r--src/style/style.cpp2
-rw-r--r--src/style/style_layer.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/map/map.cpp b/src/map/map.cpp
index e640ec68a2..4b4e58d140 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -646,7 +646,7 @@ void Map::renderLayer(std::shared_ptr<StyleLayer> 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 76ee3707bc..03881f96a0 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<BackgroundProperties>();
}
}
diff --git a/src/style/style_layer.cpp b/src/style/style_layer.cpp
index 3d5ffd6a43..1672ad4a8b 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<ClassID, ClassProperties>
: 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<std::string> &class_names, const timestamp now,