@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user