#pragma once #include #include #include #include namespace mbgl { class AsyncRequest; namespace style { /* Shared implementation for VectorSource and RasterSource. Should eventually be refactored to use composition rather than inheritance. */ class TileSourceImpl : public Source::Impl { public: static Tileset parseTileJSON(const std::string& json, const std::string& sourceURL, SourceType, uint16_t tileSize); TileSourceImpl(SourceType, std::string id, Source&, variant urlOrTileset, uint16_t tileSize); ~TileSourceImpl() override; void loadDescription(FileSource&) final; uint16_t getTileSize() const final { return tileSize; } const variant& getURLOrTileset() const { return urlOrTileset; } optional getAttribution() const override; optional> getZoomRange() const final; protected: const variant urlOrTileset; const uint16_t tileSize; Tileset tileset; std::unique_ptr req; }; } // namespace style } // namespace mbgl