[core] don't mark tiles with failed requests as obsolete

Otherwise, this will remove them from the map and overwrite the old data. This could happen e.g. when we have connection trouble and a tile needs to be refreshed, or we're displaying stale information and the connection is down.
This commit is contained in:
Konstantin Käfer
2016-01-07 12:05:51 +01:00
parent 5fe586633c
commit 180b3f125f
3 changed files with 10 additions and 2 deletions

View File

@@ -33,12 +33,16 @@ VectorTileData::VectorTileData(const TileID& id_,
Seconds expires_) {
if (err) {
error = err;
state = State::obsolete;
callback();
return;
}
// Reset the error if we didn't receive one for this request. This is to prevent old error
// messages from being displayed again, e.g. after a connection trouble cleared up.
error = nullptr;
if (!tile) {
// This is a 404 response. We're treating these as empty tiles.
state = State::parsed;
buckets.clear();
callback();