[core] Followup fix to #3037

The previous fix resulted in annotations sometimes never being added.
This would happen if, during the execution of MapContext::update where 
Update::Annotations was set, the style itself was loaded but some of
its subresources (sprite or sources) were not.

#3082 is a follow up issue to make MapContext::update less error-prone.
This commit is contained in:
John Firebaugh
2015-11-19 17:59:21 -08:00
parent 9120c19db2
commit 462af73b7e
2 changed files with 2 additions and 2 deletions

View File

@@ -169,7 +169,7 @@ void MapContext::update() {
data.setAnimationTime(Clock::now());
if (style->isLoaded() && updateFlags & Update::Annotations) {
if (style->loaded && updateFlags & Update::Annotations) {
data.getAnnotationManager()->updateStyle(*style);
updateFlags |= Update::Classes;
}

View File

@@ -100,7 +100,6 @@ private:
void emitTileDataChanged();
void emitResourceLoadingFailed(std::exception_ptr error);
bool loaded = false;
bool shouldReparsePartialTiles = false;
Observer* observer = nullptr;
@@ -112,6 +111,7 @@ private:
bool hasPendingTransitions = false;
public:
bool loaded = false;
Worker workers;
};