summaryrefslogtreecommitdiff
path: root/src/mbgl/map/map_context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/map/map_context.cpp')
-rw-r--r--src/mbgl/map/map_context.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp
index 94aedb46da..0ebcd73f8b 100644
--- a/src/mbgl/map/map_context.cpp
+++ b/src/mbgl/map/map_context.cpp
@@ -142,9 +142,11 @@ void MapContext::loadStyleJSON(const std::string& json, const std::string& base)
updateFlags |= Update::DefaultTransition | Update::Classes | Update::Zoom;
asyncUpdate->send();
+}
- auto staleTiles = data.getAnnotationManager()->resetStaleTiles();
- if (!staleTiles.empty()) {
+void MapContext::updateAnnotationTilesIfNeeded() {
+ if (data.getAnnotationManager()->getStaleTileCount()) {
+ auto staleTiles = data.getAnnotationManager()->resetStaleTiles();
updateAnnotationTiles(staleTiles);
}
}
@@ -417,4 +419,8 @@ void MapContext::onResourceLoadingFailed(std::exception_ptr error) {
}
}
+void MapContext::onSpriteStoreLoaded() {
+ updateAnnotationTilesIfNeeded();
+}
+
}