Skip to content

fix: DiscreteTileRange.contains rejects TileCoordinates of another zoom level - #2277

Open
WudgeJalk wants to merge 1 commit into
fleaflet:masterfrom
WudgeJalk:fix/tile-range-contains-zoom
Open

WudgeJalk wants to merge 1 commit into
fleaflet:masterfrom
WudgeJalk:fix/tile-range-contains-zoom

Conversation

@WudgeJalk

Copy link
Copy Markdown

Part of #2269 (step 1 of the split).

DiscreteTileRange.contains compares x/y only. TileImageView checks the coordinates of every loaded level against ranges of the target level (renderTiles, staleTiles, _errorTilesWithinRange), so a tile of another level whose x/y fall in the range is rendered and kept as if it were visible — even with every target tile ready. With a ×2 grid that only happens near the origin; with other ratios, anywhere.

One line: a TileCoordinates at another zoom is never contained. Plain Points are unaffected.

Tests: tile_range_test.dart (contains), tile_image_view_test.dart — on master a ready z9 tile is in renderTiles while all four visible z10 tiles are ready; not with the fix. Full suite passes (141).

🤖 Generated with Claude Code

…r zoom level

`contains` compared x/y only. `TileImageView` checks the coordinates of
every loaded level against ranges of the target level, so a tile of
another level whose x/y fell in the range was rendered and kept as if it
were visible, even with every target tile ready.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WudgeJalk

Copy link
Copy Markdown
Author

Heads-up: with the default transformer on Epsg3857, the modulo in contains was also masking #2270 (resize, then fit in a post-frame: #2270 (comment)). With this PR alone that case loses its tiles; #2271's one line covers it. Happy to fold that line in here if you prefer.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant