diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-04-03 13:51:11 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-04-06 10:30:01 -0700 |
commit | 7e0e55e542782273fe4ee76dfe48d44361c8bd2e (patch) | |
tree | a7064f76d3d6be07738f31e09b1df550a6dcd27f /src/mbgl/style/style.cpp | |
parent | 87d9507854590803e3e1beffb0dd13c0c07dfe25 (diff) | |
download | qtlocation-mapboxgl-7e0e55e542782273fe4ee76dfe48d44361c8bd2e.tar.gz |
Eliminate StyleSource
Fixes #695
Diffstat (limited to 'src/mbgl/style/style.cpp')
-rw-r--r-- | src/mbgl/style/style.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 4923e59da4..2fb3ccabcb 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -1,5 +1,6 @@ #include <mbgl/style/style.hpp> #include <mbgl/map/sprite.hpp> +#include <mbgl/map/source.hpp> #include <mbgl/style/style_layer.hpp> #include <mbgl/style/style_parser.hpp> #include <mbgl/style/style_bucket.hpp> @@ -36,10 +37,17 @@ void Style::cascade(const std::vector<std::string>& classes) { void Style::recalculate(float z, TimePoint now) { uv::writelock lock(mtx); + for (const auto& source : sources) { + source->enabled = false; + } + zoomHistory.update(z, now); for (const auto& layer : layers) { layer->updateProperties(z, now, zoomHistory); + if (layer->bucket && layer->bucket->source) { + layer->bucket->source->enabled = true; + } } } @@ -73,6 +81,7 @@ void Style::loadJSON(const uint8_t *const data) { StyleParser parser; parser.parse(doc); + sources = parser.getSources(); layers = parser.getLayers(); sprite_url = parser.getSprite(); glyph_url = parser.getGlyphURL(); |