diff options
Diffstat (limited to 'src/mbgl/map/map.cpp')
-rw-r--r-- | src/mbgl/map/map.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 324bcc8b5d..bfedfe1326 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -687,14 +687,22 @@ void Map::Impl::onInvalidate() { } void Map::Impl::onUpdate(Update flags) { - TimePoint timePoint = mode == MapMode::Continuous ? Clock::now() : Clock::time_point::max(); - - transform.updateTransitions(timePoint); - if (flags & Update::AnnotationData) { annotationManager.updateData(); } + // Avoid redundant update calls in still mode if: + // - It has not been explicitly requested (no still image request); or + // - Style is not loaded yet + if (mode == MapMode::Still + && (!stillImageRequest || !style->impl->isLoaded())) { + return; + } + + TimePoint timePoint = mode == MapMode::Continuous ? Clock::now() : Clock::time_point::max(); + + transform.updateTransitions(timePoint); + UpdateParameters params = { style->impl->isLoaded(), mode, |