#pragma once #include #include #include #include #include #include namespace mbgl { class TransformState; class LatLngBounds; namespace util { // Helper class to stream tile-cover results per row class TileCover { public: TileCover(const LatLngBounds&, uint8_t z); // When project == true, projects the geometry points to tile coordinates TileCover(const Geometry&, uint8_t z, bool project = true); ~TileCover(); optional next(); bool hasNext(); private: class Impl; std::unique_ptr impl; }; int32_t coveringZoomLevel(double z, style::SourceType type, uint16_t tileSize); std::vector tileCover(const TransformState&, uint8_t z, const optional& overscaledZ = nullopt); std::vector tileCover(const LatLngBounds&, uint8_t z); std::vector tileCover(const Geometry&, uint8_t z); // Compute only the count of tiles needed for tileCover uint64_t tileCount(const LatLngBounds&, uint8_t z); uint64_t tileCount(const Geometry&, uint8_t z); } // namespace util } // namespace mbgl