summaryrefslogtreecommitdiff
path: root/src/mbgl/style/sources/geojson_source.hpp
blob: 83f529087344167aa87068baa891bd2764a5d7ea (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
#pragma once

#include <mbgl/style/source.hpp>

#include <mbgl/util/rapidjson.hpp>

namespace mapbox {
namespace geojsonvt {
class GeoJSONVT;
} // namespace geojsonvt
} // namespace mapbox

namespace mbgl {

class AsyncRequest;

namespace style {

class GeoJSONSource : public Source {
public:
    static std::unique_ptr<GeoJSONSource> parse(const std::string& id,
                                                const JSValue&);

    GeoJSONSource(std::string id,
                  std::string url,
                  std::unique_ptr<Tileset>&&,
                  std::unique_ptr<mapbox::geojsonvt::GeoJSONVT>&&);
    ~GeoJSONSource() final;

    void load(FileSource&) final;

private:
    Range<uint8_t> getZoomRange() final;
    std::unique_ptr<Tile> createTile(const OverscaledTileID&, const UpdateParameters&) final;

    std::unique_ptr<mapbox::geojsonvt::GeoJSONVT> geojsonvt;
    std::unique_ptr<AsyncRequest> req;
};

} // namespace style
} // namespace mbgl