[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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user