1 #pragma once 2 3 #include <mbgl/renderer/render_source.hpp> 4 #include <mbgl/renderer/tile_pyramid.hpp> 5 #include <mbgl/style/sources/vector_source_impl.hpp> 6 7 namespace mbgl { 8 9 class RenderVectorSource : public RenderSource { 10 public: 11 RenderVectorSource(Immutable<style::VectorSource::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 style::VectorSource::Impl& impl() const; 41 42 TilePyramid tilePyramid; 43 optional<Tileset> tileset; 44 }; 45 46 template <> is() const47inline bool RenderSource::is<RenderVectorSource>() const { 48 return baseImpl->type == style::SourceType::Vector; 49 } 50 51 } // namespace mbgl 52