summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-03-24 20:27:38 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-03-24 22:02:30 +0200
commitfe1b417d046e5c86278f425682057effee5bdf28 (patch)
tree1e9509853c5ea28a7f7f1e4dafa9ea4078d66f77 /src
parentdbc7f073b8b0c0f33c3888f91182121417b09fd8 (diff)
downloadqtlocation-mapboxgl-fe1b417d046e5c86278f425682057effee5bdf28.tar.gz
[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.
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/map/map_context.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp
index ecb3503e23..b4badb20ef 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;