summaryrefslogtreecommitdiff
path: root/include/mbgl/tile
diff options
context:
space:
mode:
authorAnsis Brammanis <ansis@mapbox.com>2018-05-17 11:30:04 -0400
committerAnsis Brammanis <ansis.brammanis@gmail.com>2018-05-22 14:58:11 -0400
commit5e36f669acd756d26e2dfa6db1a2a94bd1ceb701 (patch)
tree553489b2de586e872c9c89d7d4038d5e93f5ce2d /include/mbgl/tile
parent60505b03174b5ec02ae723beafa7683f6ed54a62 (diff)
downloadqtlocation-mapboxgl-5e36f669acd756d26e2dfa6db1a2a94bd1ceb701.tar.gz
[core] avoid symbol flickering when longitude is wrapped
Diffstat (limited to 'include/mbgl/tile')
-rw-r--r--include/mbgl/tile/tile_id.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/mbgl/tile/tile_id.hpp b/include/mbgl/tile/tile_id.hpp
index 11fb5ce537..3b52596f6c 100644
--- a/include/mbgl/tile/tile_id.hpp
+++ b/include/mbgl/tile/tile_id.hpp
@@ -58,10 +58,11 @@ public:
uint32_t overscaleFactor() const;
OverscaledTileID scaledTo(uint8_t z) const;
UnwrappedTileID toUnwrapped() const;
+ OverscaledTileID unwrapTo(int16_t wrap);
- const uint8_t overscaledZ;
- const int16_t wrap;
- const CanonicalTileID canonical;
+ uint8_t overscaledZ;
+ int16_t wrap;
+ CanonicalTileID canonical;
};
::std::ostream& operator<<(::std::ostream& os, const OverscaledTileID& rhs);
@@ -191,6 +192,10 @@ inline UnwrappedTileID OverscaledTileID::toUnwrapped() const {
return { wrap, canonical };
}
+inline OverscaledTileID OverscaledTileID::unwrapTo(int16_t newWrap) {
+ return { overscaledZ, newWrap, canonical };
+}
+
inline UnwrappedTileID::UnwrappedTileID(uint8_t z_, int64_t x_, int64_t y_)
: wrap((x_ < 0 ? x_ - (1ll << z_) + 1 : x_) / (1ll << z_)),
canonical(