break out StyleSource from Source, move getActiveSources and updateSources into Map::Map

This commit is contained in:
Mike Morris
2014-07-10 16:29:49 -07:00
parent 1268fafe0b
commit 53e995acae
12 changed files with 88 additions and 55 deletions

View File

@@ -15,36 +15,9 @@ namespace llmr {
Style::Style() {
}
void Style::updateSources() {
activeSources.clear();
updateSources(layers);
}
const std::set<std::shared_ptr<Source>> Style::getActiveSources() const {
return activeSources;
}
void Style::updateSources(const std::shared_ptr<StyleLayerGroup> &group) {
if (!group) {
return;
}
for (const std::shared_ptr<StyleLayer> &layer : group->layers) {
if (!layer) continue;
if (layer->bucket) {
if (layer->bucket->source) {
activeSources.emplace(layer->bucket->source);
}
} else if (layer->layers) {
updateSources(layer->layers);
}
}
}
void Style::updateProperties(float z, timestamp now) {
uv::writelock lock(mtx);
updateSources();
if (layers) {
layers->updateProperties(z, now);
}