refactor source information into SourceInfo object

This commit is contained in:
Konstantin Käfer
2014-07-17 15:37:18 -07:00
parent d3aeed6cf2
commit 3141b8b1f7
5 changed files with 38 additions and 44 deletions

View File

@@ -421,13 +421,13 @@ void Map::updateSources() {
updateSources(style->layers);
// Then, construct or destroy the actual source object, depending on enabled state.
for (const std::shared_ptr<StyleSource> &source : activeSources) {
if (source->enabled) {
if (!source->source) {
source->source = std::make_shared<Source>(*source, getAccessToken());
for (const std::shared_ptr<StyleSource> &style_source : activeSources) {
if (style_source->enabled) {
if (!style_source->source) {
style_source->source = std::make_shared<Source>(style_source->info, getAccessToken());
}
} else {
source->source.reset();
style_source->source.reset();
}
}