#pragma once #include #include #include #include #include #include #include #include namespace mbgl { class Style; class StyleLayer; class AsyncRequest; class GeometryTileMonitor; class FeatureIndex; class VectorTileData : public TileData { public: VectorTileData(const OverscaledTileID&, std::unique_ptr monitor, std::string sourceID, Style&, const MapMode, const std::function& callback); ~VectorTileData(); Bucket* getBucket(const StyleLayer&) override; bool parsePending(std::function callback) override; void redoPlacement(PlacementConfig config, const std::function&) override; void redoPlacement(const std::function&) override; void queryRenderedFeatures( std::unordered_map>& result, const GeometryCoordinates& queryGeometry, const TransformState&, const optional>& layerIDs) override; void cancel() override; private: std::vector> cloneStyleLayers() const; const std::string sourceID; Style& style; Worker& worker; TileWorker tileWorker; std::unique_ptr monitor; std::unique_ptr tileRequest; std::unique_ptr workRequest; // Contains all the Bucket objects for the tile. Buckets are render // objects and they get added by tile parsing operations. std::unordered_map> buckets; std::unique_ptr featureIndex; std::unique_ptr geometryTile; // Stores the placement configuration of the text that is currently placed on the screen. PlacementConfig placedConfig; // Stores the placement configuration of how the text should be placed. This isn't necessarily // the one that is being displayed. PlacementConfig targetConfig; // Used to signal the worker that it should abandon parsing this tile as soon as possible. util::Atomic obsolete { false }; }; } // namespace mbgl