blob: 97f0a7e5a81e5b3f14eceb2ea5199c9a24a946c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#pragma once
#include <mbgl/style/source.hpp>
#include <mbgl/util/tileset.hpp>
#include <mbgl/util/variant.hpp>
namespace mbgl {
class AsyncRequest;
namespace style {
class VectorSource final : public Source {
public:
VectorSource(std::string id, variant<std::string, Tileset> urlOrTileset, optional<float> maxZoom = nullopt,
optional<float> minZoom = nullopt);
~VectorSource() final;
const variant<std::string, Tileset>& getURLOrTileset() const;
optional<std::string> getURL() const;
class Impl;
const Impl& impl() const;
void loadDescription(FileSource&) final;
mapbox::base::WeakPtr<Source> makeWeakPtr() override {
return weakFactory.makeWeakPtr();
}
private:
const variant<std::string, Tileset> urlOrTileset;
std::unique_ptr<AsyncRequest> req;
mapbox::base::WeakPtrFactory<Source> weakFactory {this};
optional<float> maxZoom;
optional<float> minZoom;
};
template <>
inline bool Source::is<VectorSource>() const {
return getType() == SourceType::Vector;
}
} // namespace style
} // namespace mbgl
|