Skip to content

refactor(geo-layers): prioritize tile requests by viewport center#10364

Open
charlieforward9 wants to merge 5 commits into
masterfrom
codex/tile-center-priority
Open

refactor(geo-layers): prioritize tile requests by viewport center#10364
charlieforward9 wants to merge 5 commits into
masterfrom
codex/tile-center-priority

Conversation

@charlieforward9

@charlieforward9 charlieforward9 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator
geo-layer-center-priority.mov

Goals

  • Improve TileLayer request scheduling so the viewport center loads first during pan, zoom, and globe transitions.
  • Make center-priority scheduling the default behavior, without adding a public request-priority accessor.

Changes

  • Adds internal request-priority plumbing from Tileset2D to Tile2DHeader so queued requests can be ordered by the active viewport.
  • Prioritizes queued, relevant tiles by viewport-center distance; tiles containing the center get the best score, and stale queued tiles still return negative priority so they can be cancelled.
  • Documents the default scheduling behavior under maxRequests.
  • Adds focused tests for scheduler ordering, center-distance priority, unprojectable fallback, and stale cancellation.

Validation

  • yarn test-headless test/modules/geo-layers/tileset-2d/tile-2d-header.spec.ts test/modules/geo-layers/tileset-2d/tileset-2d.spec.ts passed (22 tests).
  • yarn lint passed with existing repo-wide warnings only.

@coveralls

coveralls commented Jun 10, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 83.424% (+0.03%) from 83.391% — codex/tile-center-priority into master

@charlieforward9 charlieforward9 changed the title Add tile request priority accessor feat(geo-layers): tile request priority accessor Jun 10, 2026
Comment thread docs/api-reference/geo-layers/tile-layer.md Outdated
@charlieforward9 charlieforward9 changed the title feat(geo-layers): tile request priority accessor feat(geo-layers): prioritize tile requests by viewport center Jun 11, 2026
Comment thread docs/api-reference/geo-layers/tile-layer.md Outdated
Comment thread test/modules/geo-layers/tileset-2d/tileset-2d.spec.ts Outdated
@chrisgervang

Copy link
Copy Markdown
Collaborator

Please update the PR description and address the small comments. Then should be ready

@chrisgervang chrisgervang mentioned this pull request Jun 11, 2026
53 tasks
@chrisgervang chrisgervang added this to the v9.4 milestone Jun 11, 2026
@charlieforward9 charlieforward9 self-assigned this Jun 11, 2026
@charlieforward9 charlieforward9 changed the title feat(geo-layers): prioritize tile requests by viewport center refactor(geo-layers): prioritize tile requests by viewport center Jun 11, 2026
@charlieforward9

Copy link
Copy Markdown
Collaborator Author

feature -> refactor

good to go! @chrisgervang

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.

3 participants