#ifndef MBGL_MAP_VECTOR_TILE #define MBGL_MAP_VECTOR_TILE #include #include #include #include namespace mbgl { class VectorTileLayer; class VectorTileFeature : public GeometryTileFeature { public: VectorTileFeature(pbf, const VectorTileLayer&); FeatureType getType() const override { return type; } optional getValue(const std::string&) const override; GeometryCollection getGeometries() const override; uint32_t getExtent() const override; private: const VectorTileLayer& layer; uint64_t id = 0; FeatureType type = FeatureType::Unknown; pbf tags_pbf; pbf geometry_pbf; }; class VectorTileLayer : public GeometryTileLayer { public: VectorTileLayer(pbf); std::size_t featureCount() const override { return features.size(); } util::ptr getFeature(std::size_t) const override; private: friend class VectorTile; friend class VectorTileFeature; std::string name; uint32_t extent = 4096; std::map keys; std::vector values; std::vector features; }; class VectorTile : public GeometryTile { public: VectorTile(std::shared_ptr data); util::ptr getLayer(const std::string&) const override; private: std::shared_ptr data; mutable bool parsed = false; mutable std::map> layers; }; class TileID; class FileSource; class VectorTileMonitor : public GeometryTileMonitor { public: VectorTileMonitor(const TileID&, float pixelRatio, const std::string& urlTemplate, FileSource&); std::unique_ptr monitorTile(const GeometryTileMonitor::Callback&) override; private: TileID tileID; float pixelRatio; std::string urlTemplate; FileSource& fileSource; }; } // namespace mbgl #endif