feat(examples): add tile loading indicator - #624
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Seems related to visgl/deck.gl#10359 but external to the layer rendering. Interested in getting a review pass on it to see if it could land by 9.4 @kylebarron |
Contributor
Revises the tile loading indicator spec to use deck.gl's LoadingWidget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaced by deck.gl's LoadingWidget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wires deck.gl's LoadingWidget into every example that renders through DeckGlOverlay, and updates the spec's scope to match. Co-Authored-By: Claude Opus 5.5 <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.

Screen.Recording.2026-09-23.at.3.32.15.PM.mov
Note
This PR description was written by Claude (Claude Code) on behalf of @kylebarron, not by @kylebarron.
Closes #599.
Shows a spinner in the example apps while map tiles are loading, using deck.gl's built-in
LoadingWidgetfrom@deck.gl/widgets.What changed
examples/_shared/styles/loading-widget.tsexportsloadingWidgetProps. It places the widget top-right (the control panel sits top-left) and sets deck.gl's widget theme variables to match the Chakra control panel.Each wired example imports
@deck.gl/widgets/stylesheet.cssand passes the widget to the shared overlay:Wired into every example that renders through
DeckGlOverlay:COGLayer:cog-basic,cog-globe,land-cover,usgs-topo-cutline,vermont-cog-comparisonMosaicLayerofCOGLayers:naip-mosaicMultiCOGLayer:sentinel-2ZarrLayer:aef-mosaic,dynamical-zarr-ecmwf,nldas-icechunk,zarr-sentinel2-tciglobe-viewandtitiler-cogdon't useDeckGlOverlay, so they're unchanged.How it works
LoadingWidgetchecksisLoadedon every layer deck has applied, on each redraw. That signal already covers nested layers:TileLayer.isLoadedrequires every selected tile and the sublayers drawn for it to be loaded.So in
naip-mosaicthe spinner waits for each source's image tiles, not just the GeoTIFF headers. #667 madeCOGLayer,MultiCOGLayerandZarrLayerreport "not loaded" while their metadata is still loading, so the spinner also covers the header or metadata fetch.Why not the first version of this PR
The first version turned loading on from the map's
onMoveStartand off from the layer'sonViewportLoad. That broke in three ways:onViewportLoadonly fires when the set of visible tiles changes, so a small pan left it stuck.naip-mosaiccleared too early. ItsonViewportLoadfires once the GeoTIFF headers are open, before any imagery has loaded.aef-mosaic.Known behavior
cog-basic, or a new location inaef-mosaic), the spinner can disappear for part of the flight. While the target is off-screen or the map is zoomed out below the layer'sminZoom, there are no tiles to wait for. It comes back as soon as the new area needs tiles.naip-mosaic's STAC query fails, the example drops the widget. With no layers, deck never redraws, so the widget would otherwise keep spinning.Testing
pnpm -r typecheckandpnpm checkpass.cog-basic: switching COG;naip-mosaic: a blocked STAC request;aef-mosaic: year change, band sliders and location fly-to.zarr-sentinel2-tcineeds locally served GeoZarr data, so it was only typechecked.aef-mosaic,dynamical-zarr-ecmwf,nldas-icechunk) were checked against production builds. Undervite devthey currently fail withWebGL context already attached, a ReactStrictModeissue that exists without this PR. That will be investigated separately.🤖 Written by Claude Code