[geo-layers] Prioritize tile requests near viewport center#10294
[geo-layers] Prioritize tile requests near viewport center#10294charlieforward9 wants to merge 9 commits into
Conversation
a66bfa0 to
ecd4c24
Compare
felixpalmer
left a comment
There was a problem hiding this comment.
Would be nice to see a video of this in action, shouldn't be too hard if you use a small tile size and potentially throttle your network.
Otherwise, like the idea - integrates nicely
| return this._getTileDistanceToViewportCenter(tile); | ||
| } | ||
| if (tile.isVisible) { | ||
| return 1e6 + this._getTileDistanceToViewportCenter(tile); |
There was a problem hiding this comment.
Isn't this backwards? the further we are from center, the higher this value and thus the higher the priority?
There was a problem hiding this comment.
Addressed in 426b06e. This is intentionally ordered this way: loaders.gl RequestScheduler sorts queued requests ascending and loads lower priority values first, so smaller squared distance means higher effective priority. I added a code comment at the call site to make that explicit.
There was a problem hiding this comment.
So why the -1? Doesn't this mean tiles which are not selected and not visible get loaded first?
| return -1; | ||
| } | ||
|
|
||
| private _getTileDistanceToViewportCenter(tile: Tile2DHeader): number { |
There was a problem hiding this comment.
| private _getTileDistanceToViewportCenter(tile: Tile2DHeader): number { | |
| private _getTileDistanceSquared(tile: Tile2DHeader): number { |
There was a problem hiding this comment.
Addressed in 426b06e. Renamed the helper to _getTileDistanceSquared so the method name matches the value returned.
|
Review follow-up pushed in 426b06e. What changed:
Verification:
|
i want to explore a more responsive LoD refinementStrategy and globe cache approach for improving GlobeView initialization and flyToTransition UX - Google Earth feel. Latest experiment in this direction
Summary
Adds a Tileset2D request priority callback so visible tile requests can be ordered by distance from the viewport center.
This keeps center tiles ahead of edge tiles during throttled loading without changing TileLayer's public API.
Validation
npx vitest run --project headless test/modules/geo-layers/tileset-2d/tile-2d-header.spec.tsStacked on #10250 /
cr/feat/terrain-layer-globe-grid.