Files
MapLibreParticleLab/src/mbgl/map/raster_tile_data.hpp
Konstantin Käfer 32a2359e86 [core] don't store error state
Previously, we could first get a stale response from cache, then immediately a "connection error" response that overwrote the error state variable. In the tileLoadingCompleteCallback, we'd only see the second overwritten error state and abort. This could lead to the map sometimes not being rendered at all until the user interacts with the map.
2016-01-15 17:04:08 +01:00

41 lines
826 B
C++

#ifndef MBGL_MAP_RASTER_TILE_DATA
#define MBGL_MAP_RASTER_TILE_DATA
#include <mbgl/map/tile_data.hpp>
#include <mbgl/renderer/raster_bucket.hpp>
namespace mbgl {
class FileRequest;
class StyleLayer;
class TexturePool;
class WorkRequest;
class RasterTileData : public TileData {
public:
RasterTileData(const TileID&, TexturePool&, Worker&);
~RasterTileData();
using Callback = std::function<void(std::exception_ptr)>;
void request(const std::string& url,
const Callback& callback);
void cancel() override;
Bucket* getBucket(StyleLayer const &layer_desc) override;
private:
TexturePool& texturePool;
Worker& worker;
std::unique_ptr<FileRequest> req;
std::unique_ptr<Bucket> bucket;
std::unique_ptr<WorkRequest> workRequest;
};
} // namespace mbgl
#endif