[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.
This commit is contained in:
Bruno de Oliveira Abinader
2016-03-24 20:27:38 +02:00
parent dbc7f073b8
commit fe1b417d04

View File

@@ -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;