#pragma once #include #include #include namespace mbgl { class AsyncRequest; namespace style { class RasterSource : public Source { public: RasterSource(std::string id, variant urlOrTileset, uint16_t tileSize, SourceType sourceType = SourceType::Raster); ~RasterSource() override; const variant& getURLOrTileset() const; optional getURL() const; uint16_t getTileSize() const; class Impl; const Impl& impl() const; void loadDescription(FileSource&) final; bool supportsLayerType(const mbgl::style::LayerTypeInfo*) const override; mapbox::base::WeakPtr makeWeakPtr() final { return weakFactory.makeWeakPtr(); } private: const variant urlOrTileset; std::unique_ptr req; mapbox::base::WeakPtrFactory weakFactory {this}; }; template <> inline bool Source::is() const { return getType() == SourceType::Raster; } } // namespace style } // namespace mbgl