Fix glitchy labels layer when zoom changes, make labels sublayer ids unique per tile - #44
Conversation
|
Warning Review limit reached
More reviews will be available in 57 minutes and 11 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR updates labels bitmask sub-layer ID generation to incorporate tile coordinates (z, x, y) alongside existing bounds and parent layer ID, ensuring unique identifiers across zoom levels and tile positions. A new test validates this behavior; three test suites are refactored to use a centralized ID constant instead of hardcoded duplicates. ChangesLabels Bitmask Sub-Layer ID Enhancement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…71) The MultiscaleLabelsTileLayer was created with minZoom: -20, so deck.gl kept subdividing the tile grid below the deepest available resolution level. Past that level getTileData clamps to the deepest loader and returns the same data, but the tile bbox keeps doubling — so the bounds formula stretched that fixed data across an ever-larger world rect, far beyond the image extent. This is the "labels switch to an obviously wrong transformation at certain zoom levels" bug (PR #44 only masked a related texture-reuse artifact via unique sublayer ids). Cap minZoom at -(loader.length - 1), matching Viv's MultiscaleImageLayer, so the coarsest real tiles stay correctly placed at any zoom-out. Also add the bbox-culling guards Viv's renderSubLayers applies (skip negative-edge or zero-sized tiles) for defense in depth. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
multiscalelabels bitmask sublayers could reuse the same deck layer id across different tile resolutions when their world bounds matched. DuringviewStatechanges, deck could transfer stale tile/texture state between those layers, leading to intermittent bad transformations.Summary by CodeRabbit