1 #pragma once
2 
3 #include <mbgl/style/source.hpp>
4 #include <mbgl/util/tileset.hpp>
5 #include <mbgl/util/variant.hpp>
6 
7 namespace mbgl {
8 
9 class AsyncRequest;
10 
11 namespace style {
12 
13 class VectorSource : public Source {
14 public:
15     VectorSource(std::string id, variant<std::string, Tileset> urlOrTileset);
16     ~VectorSource() final;
17 
18     const variant<std::string, Tileset>& getURLOrTileset() const;
19     optional<std::string> getURL() const;
20 
21     class Impl;
22     const Impl& impl() const;
23 
24     void loadDescription(FileSource&) final;
25 
26 private:
27     const variant<std::string, Tileset> urlOrTileset;
28     std::unique_ptr<AsyncRequest> req;
29 };
30 
31 template <>
is() const32 inline bool Source::is<VectorSource>() const {
33     return getType() == SourceType::Vector;
34 }
35 
36 } // namespace style
37 } // namespace mbgl
38