#pragma once #include #include #include namespace mbgl { class AsyncRequest; namespace style { class VectorSource final : public Source { public: VectorSource(std::string id, variant urlOrTileset, std::optional maxZoom = std::nullopt, std::optional minZoom = std::nullopt); ~VectorSource() final; const variant& getURLOrTileset() const; std::optional getURL() const; class Impl; const Impl& impl() const; void loadDescription(FileSource&) final; /// @brief Gets the tile urls for this vector source. /// @return List of tile urls. const std::vector getTiles() const; /// @brief Sets the tile urls for this vector source. /// @param tiles List of tile urls. void setTiles(const std::vector& tiles); bool supportsLayerType(const mbgl::style::LayerTypeInfo*) const override; mapbox::base::WeakPtr makeWeakPtr() override { return weakFactory.makeWeakPtr(); } protected: Mutable createMutable() const noexcept final; private: const variant urlOrTileset; std::unique_ptr req; std::optional maxZoom; std::optional minZoom; mapbox::base::WeakPtrFactory weakFactory{this}; // Do not add members here, see `WeakPtrFactory` }; template <> inline bool Source::is() const { return getType() == SourceType::Vector; } } // namespace style } // namespace mbgl