From fe1b417d046e5c86278f425682057effee5bdf28 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Thu, 24 Mar 2016 20:27:38 +0200 Subject: [PATCH] [core] Update time point in map context on every update Previous behavior prevented view from notifying when map was fully loaded, because the style sources relies on a future time point for checking if their tiles are updated. This was first caught only in still mode, but also happens in continuous mode for platforms that rely on View::notifyMapChange for updating the view. --- src/mbgl/map/map_context.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index ecb3503e2..b4badb20e 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -164,6 +164,11 @@ void MapContext::update() { return; } + // This time point is used to: + // - Calculate style property transitions; + // - Hint style sources to notify when all its tiles are loaded; + frameData.timePoint = Clock::now(); + if (style->loaded && updateFlags & Update::Annotations) { data.getAnnotationManager()->updateStyle(*style); updateFlags |= Update::Classes; @@ -181,12 +186,8 @@ void MapContext::update() { if (data.mode == MapMode::Continuous) { asyncInvalidate.send(); - } else { - // Update time point so style sources can check they are loaded. - frameData.timePoint = Clock::now(); - if (callback && style->isLoaded()) { - renderSync(transformState, frameData); - } + } else if (callback && isLoaded()) { + renderSync(transformState, frameData); } updateFlags = Update::Nothing;