1 #pragma once
2 
3 #include <mbgl/renderer/render_source.hpp>
4 #include <mbgl/renderer/tile_pyramid.hpp>
5 #include <mbgl/annotation/annotation_source.hpp>
6 
7 namespace mbgl {
8 
9 class RenderAnnotationSource : public RenderSource {
10 public:
11     RenderAnnotationSource(Immutable<AnnotationSource::Impl>);
12 
13     bool isLoaded() const final;
14 
15     void update(Immutable<style::Source::Impl>,
16                 const std::vector<Immutable<style::Layer::Impl>>&,
17                 bool needsRendering,
18                 bool needsRelayout,
19                 const TileParameters&) final;
20 
21     void startRender(PaintParameters&) final;
22     void finishRender(PaintParameters&) final;
23 
24     std::vector<std::reference_wrapper<RenderTile>> getRenderTiles() final;
25 
26     std::unordered_map<std::string, std::vector<Feature>>
27     queryRenderedFeatures(const ScreenLineString& geometry,
28                           const TransformState& transformState,
29                           const std::vector<const RenderLayer*>& layers,
30                           const RenderedQueryOptions& options,
31                           const mat4& projMatrix) const final;
32 
33     std::vector<Feature>
34     querySourceFeatures(const SourceQueryOptions&) const final;
35 
36     void reduceMemoryUse() final;
37     void dumpDebugLogs() const final;
38 
39 private:
40     const AnnotationSource::Impl& impl() const;
41 
42     TilePyramid tilePyramid;
43 };
44 
45 template <>
is() const46 inline bool RenderSource::is<RenderAnnotationSource>() const {
47     return baseImpl->type == style::SourceType::Annotations;
48 }
49 
50 } // namespace mbgl
51