diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/tile/tile_id.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/mbgl/tile/tile_id.hpp b/include/mbgl/tile/tile_id.hpp index 3b52596f6c..dd2fba573d 100644 --- a/include/mbgl/tile/tile_id.hpp +++ b/include/mbgl/tile/tile_id.hpp @@ -85,9 +85,10 @@ public: std::array<UnwrappedTileID, 4> children() const; OverscaledTileID overscaleTo(uint8_t z) const; float pixelsToTileUnits(float pixelValue, float zoom) const; + UnwrappedTileID unwrapTo(int16_t wrap); - const int16_t wrap; - const CanonicalTileID canonical; + int16_t wrap; + CanonicalTileID canonical; }; ::std::ostream& operator<<(::std::ostream& os, const UnwrappedTileID& rhs); @@ -220,6 +221,10 @@ inline bool UnwrappedTileID::operator<(const UnwrappedTileID& rhs) const { return std::tie(wrap, canonical) < std::tie(rhs.wrap, rhs.canonical); } +inline UnwrappedTileID UnwrappedTileID::unwrapTo(int16_t newWrap) { + return { newWrap, canonical }; +} + inline bool UnwrappedTileID::isChildOf(const UnwrappedTileID& parent) const { return wrap == parent.wrap && canonical.isChildOf(parent.canonical); } |