diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/map/source.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/map/tile_data.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/map/vector_tile_data.cpp | 6 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/mbgl/map/source.cpp b/src/mbgl/map/source.cpp index 4432b3a490..613972e930 100644 --- a/src/mbgl/map/source.cpp +++ b/src/mbgl/map/source.cpp @@ -531,7 +531,7 @@ void Source::tileLoadingCompleteCallback(const TileID& tileID, const TransformSt return; } - if (tileData->getState() == TileData::State::obsolete && tileData->getError()) { + if (tileData->hasError()) { observer->onTileError(*this, tileID, tileData->getError()); return; } diff --git a/src/mbgl/map/tile_data.hpp b/src/mbgl/map/tile_data.hpp index 2bb11054a6..e31cced964 100644 --- a/src/mbgl/map/tile_data.hpp +++ b/src/mbgl/map/tile_data.hpp @@ -88,6 +88,10 @@ public: return state; } + bool hasError() const { + return error.operator bool(); + } + std::exception_ptr getError() const { return error; } diff --git a/src/mbgl/map/vector_tile_data.cpp b/src/mbgl/map/vector_tile_data.cpp index f44dc75982..ee43373a69 100644 --- a/src/mbgl/map/vector_tile_data.cpp +++ b/src/mbgl/map/vector_tile_data.cpp @@ -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(); |