Repository navigation
Conversation
Add Deck#_getTransitionTarget(viewId). It returns the end view state, the end viewport and the remaining time of the active view state transition of a view, or null. Controller#getTransitionTarget and ViewManager#getTransitionTarget supply it from the TransitionManager. Layers can use it to load data for the destination while the transition runs. It works for every TransitionInterpolator and for each view with a controller.
Add the experimental TileLayer prop _preloadTransitionTarget (default false). While a view state transition runs, the layer passes the end viewport from Deck#_getTransitionTarget to Tileset2D#update as preloadViewport. Tileset2D requests the tiles that cover that viewport before all other tiles, in index order, without selecting or rendering them. Preload tiles are not aborted as off-screen tiles, and LRU order evicts them after older tiles. The set is capped so that it and the selected tiles fit the tile-count limit of the cache. A null viewport clears the set, and the scheduler then cancels its queued requests. The maxRequests limit applies to all requests. The shared path supports the same: Tile2DView#update takes preloadViewport and Tileset2D#updateConsumer takes preloadIndices. The proposed Tile2DLayer forwards the prop once for each enabled view. With the prop off, the request priorities, abort and eviction rules are unchanged.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
The cache eviction treated preload tiles as unused tiles. Visible placeholder tiles and the preload tiles of other consumers also took cache space, but the preload cap counted only the selected tiles. Thus an update could evict and abort the preload tiles that it requested. Cache eviction now keeps the preload tiles. The preload cap counts all tiles that eviction keeps: the selected tiles, the visible tiles and the preload tiles of all consumers. Tileset2D#update makes the preload set after the visibility update, so that the cap counts the placeholders of the frame. When the kept tiles need more space, the preload sets shrink in rank order and keep the best tiles. The selected and visible tiles do not change. With the prop off, no preload set exists and nothing changes.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit bbfbd4c. Configure here.
The preload set is not selected, but best-available refinement shows a loaded descendant of a selected tile that has not loaded. In a zoom-in transition, preload tiles are such descendants. State this in the docs and pin it with a test.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
A
FlyToInterpolatororLinearInterpolatortransition knows its destination from the first frame. The tile layers do not use this. They request only the tiles of each interpolated frame, and most of these frames are gone before their tiles arrive. On a slow network, the destination reaches full detail long after the camera stops. This PR lets the tile layers load the tiles of the destination view at the best request priority while the flight runs. It is experimental and opt-in.Change
Deck#_getTransitionTarget(viewId)(experimental) returns{viewState, viewport, remainingTime}for the active view state transition of a view, ornull.Controller#getTransitionTarget()andViewManager#getTransitionTarget()supply it from theTransitionManager. It works for every interpolator, for MapView and GlobeView, and for each view with a controller.TileLayergets the prop_preloadTransitionTarget(defaultfalse). While a transition runs,Tileset2D#updatereceives the end viewport aspreloadViewport. Its tiles load before all other tiles and are not selected or rendered. They are not aborted as off-screen tiles, and LRU order evicts them last. The set is capped so that it and the selected tiles fit the tile-count limit of the cache.maxRequestsapplies to all requests. The set clears when the transition ends or stops.Tile2DView#updatetakespreloadViewport, andTileset2D#updateConsumertakespreloadIndices. The proposedTile2DLayerforwards the prop for each enabled view.This change does not depend on #10306 (coverage LOD, by charlieforward9). The two combine well: see Testing.
Screenshots
A local demo page with two
Deckinstances and one fly-to (z5 to z14, 4 s,FlyToInterpolator). The tile server answers after 400 ms, andmaxRequestsis 2. Tiles are coloured by zoom: z11 teal, z12 yellow, z13 red, z14 (the destination) green. Left: master. Right:_preloadTransitionTarget: true. Headless Chrome, ANGLE Metal.Late in the flight. The right side already has the destination tiles for the next frames:
About 400 ms after the stop. The left side still waits for z14 tiles. The right side was at full detail when the camera stopped:
Testing
Note
Medium Risk
Modifies tile request scheduling and cache retention logic within
Tileset2D, though risk is mitigated by gating the behavior behind an opt-in experimental prop.Overview
Adds an experimental capability to preload destination tiles during view transitions, reducing latency and visual pop-in when camera flights finish.
In
@deck.gl/core, introduces_getTransitionTargetacrossTransitionManager,Controller,ViewManager, andDeckto expose the active transition's destination view state, viewport, and remaining time for controlled views.In
@deck.gl/geo-layersand@deck.gl/proposals, adds an opt-in_preloadTransitionTargetprop toTileLayerandTile2DLayer. When enabled,Tileset2Dprioritizes fetching the destination viewport's tiles ahead of intermediate transition frames without selecting or rendering them, protects them from premature eviction and request abortion, and clears them once the transition ends or cancels.Reviewed by Cursor Bugbot for commit 16941ac. Bugbot is set up for automated code reviews on this repo. Configure here.