summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/sources/render_geojson_source.hpp
blob: 3896457806f6f46c977062a9e71e7461130110bb (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
#pragma once

#include <mbgl/renderer/sources/render_tile_source.hpp>
#include <mbgl/style/sources/geojson_source_impl.hpp>

namespace mbgl {

namespace style {
class GeoJSONData;
} // namespace style

class RenderGeoJSONSource final : public RenderTileSource {
public:
    explicit RenderGeoJSONSource(Immutable<style::GeoJSONSource::Impl>);
    ~RenderGeoJSONSource() override;

    void update(Immutable<style::Source::Impl>,
                const std::vector<Immutable<style::LayerProperties>>&,
                bool needsRendering,
                bool needsRelayout,
                const TileParameters&) override;

    FeatureExtensionValue
    queryFeatureExtensions(const Feature& feature,
                           const std::string& extension,
                           const std::string& extensionField,
                           const optional<std::map<std::string, Value>>& args) const override;

private:
    const style::GeoJSONSource::Impl& impl() const;

    std::weak_ptr<style::GeoJSONData> data;
};

template <>
inline bool RenderSource::is<RenderGeoJSONSource>() const {
    return baseImpl->type == style::SourceType::GeoJSON;
}

} // namespace mbgl