Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Followup fix to #3037
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jfirebaugh committed Nov 20, 2015
1 parent dc5a55c commit afa04de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mbgl/map/map_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/mbgl/style/style.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ class Style : public GlyphStore::Observer,
void emitTileDataChanged();
void emitResourceLoadingFailed(std::exception_ptr error);

bool loaded = false;
bool shouldReparsePartialTiles = false;

Observer* observer = nullptr;
Expand All @@ -112,6 +111,7 @@ class Style : public GlyphStore::Observer,
bool hasPendingTransitions = false;

public:
bool loaded = false;
Worker workers;
};

Expand Down

0 comments on commit afa04de

Please sign in to comment.