feat(geo-layers): Add getTileLoadingState for granular tile loading info#10372
Open
akre54 wants to merge 4 commits into
Open
feat(geo-layers): Add getTileLoadingState for granular tile loading info#10372akre54 wants to merge 4 commits into
akre54 wants to merge 4 commits into
Conversation
…oading info Adds a new utility function getTileLoadingState() that provides detailed information about tile loading progress in TileLayer instances. Background: ----------- deck.gl's layer.isLoaded returns true once all tile requests are 'settled' (completed OR failed). This is intentional - it prevents waiting forever for tiles that will never load (404s, network errors, etc.). However, this makes it impossible to distinguish between 'loaded successfully' and 'loaded with errors' using just the boolean isLoaded property. Solution: --------- getTileLoadingState() provides granular information: - Total, loaded, failed, and pending tile counts - Percentage loaded for progress indicators - isComplete and isSuccess flags for state detection This allows applications to: - Show loading progress (e.g., '47/50 tiles loaded') - Detect and handle failed tiles - Implement retry logic for failed tiles - Display appropriate error states Use Cases: ---------- - Video export: Wait for all tiles to settle before capturing frames - Progress indicators: Show percentage loaded with error counts - Error recovery: Retry failed tiles up to N times - Analytics: Track tile loading success rates Related: -------- This addresses feedback from PR visgl#10360 about improving tile loading observability without changing the core isLoaded behavior (which is correct by design).
- Convert from tape to vitest test framework - Move test file to correct location (test/modules/geo-layers/) - Add copyright headers - Register test in index.ts - Add getTileLoadingState to top-level imports test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Adds a new utility function
getTileLoadingState()that provides detailed information about tile loading progress in TileLayer instances.Background
After investigating feedback from PR #10360, I discovered that deck.gl's
layer.isLoadedbehavior is intentional and correct:layer.isLoadedreturnstrueonce all tile requests are "settled" (completed OR failed)content === null. Once Tile2DHeader marks those requests as loaded, do not wait for generated sublayers because there is nothing to render for that tile andtile.layerswill remain null."However, this makes it impossible to distinguish between "loaded successfully" and "loaded with errors" using just the boolean
isLoadedproperty.Solution
getTileLoadingState()provides granular information:Use Cases
1. Video Export
Wait for all tiles to settle (loaded or failed) before capturing frames:
2. Progress Indicators
Show detailed loading progress with error counts:
3. Error Recovery
Retry failed tiles up to N times:
Implementation
tile.content === nullto identify failed tilesComparison
Before (boolean only):
After (granular state):
Related
This addresses the feedback from PR #10360 about improving tile loading observability. After investigation, I concluded that:
isLoadedbehavior is correct by design (prevents deadlocks)@deck.gl/geo-layers(as suggested by @chrisgervang)Testing
layer.isLoadedcan betruewhilestate.isSuccessisfalseChecklist
@deck.gl/geo-layers