1 #pragma once
2 
3 #include <mbgl/style/source_impl.hpp>
4 #include <mbgl/style/sources/geojson_source.hpp>
5 #include <mbgl/util/range.hpp>
6 
7 namespace mbgl {
8 
9 class AsyncRequest;
10 class CanonicalTileID;
11 
12 namespace style {
13 
14 class GeoJSONData {
15 public:
16     virtual ~GeoJSONData() = default;
17     virtual mapbox::geometry::feature_collection<int16_t> getTile(const CanonicalTileID&) = 0;
18 };
19 
20 class GeoJSONSource::Impl : public Source::Impl {
21 public:
22     Impl(std::string id, GeoJSONOptions);
23     Impl(const GeoJSONSource::Impl&, const GeoJSON&);
24     ~Impl() final;
25 
26     Range<uint8_t> getZoomRange() const;
27     GeoJSONData* getData() const;
28 
29     optional<std::string> getAttribution() const final;
30 
31 private:
32     GeoJSONOptions options;
33     std::unique_ptr<GeoJSONData> data;
34 };
35 
36 } // namespace style
37 } // namespace mbgl
38