Skip to content

refactor: MultiCOGLayer extends RasterTileLayer#499

Open
kylebarron wants to merge 3 commits intomainfrom
kyle/multi-cog-extends-raster-tile-layer
Open

refactor: MultiCOGLayer extends RasterTileLayer#499
kylebarron wants to merge 3 commits intomainfrom
kyle/multi-cog-extends-raster-tile-layer

Conversation

@kylebarron
Copy link
Copy Markdown
Member

Summary

  • Migrate MultiCOGLayer to extend RasterTileLayer instead of CompositeLayer. Drops ~165 lines of duplicated wiring (globe/mercator branching, signal combining, RasterLayer construction, RasterTileset2D factory subclass) — all already provided by RasterTileLayer.
  • Multi-source fetch + stitch + UV transform logic stays in MultiCOGLayer._getTileData (now consuming the base's combined options.signal instead of recomposing).
  • Rich per-band debug overlay (per-source tile outlines + tiered text labels) moves to a new protected _renderExtraSubLayers(tile, data) hook on RasterTileLayer that subclasses can override; default returns [].
  • No public API change. MultiCOGLayerProps and runtime behavior unchanged.

Spec: dev-docs/specs/2026-05-01-multi-cog-layer-extends-raster-tile-layer-design.md

Refs #417. First of three planned PRs (this one is the mechanical refactor; follow-ups will add the new getTileData/renderTile extension points and an NLCD animation example).

Test plan

  • pnpm -r --filter '!docs' typecheck passes
  • pnpm --filter @developmentseed/deck.gl-raster --filter @developmentseed/deck.gl-geotiff --filter @developmentseed/deck.gl-zarr test passes (currently 79 + 4 + 11)
  • examples/sentinel-2 renders correctly with default band preset
  • Toggling band presets in examples/sentinel-2 swaps composite cleanly with no console errors
  • With debug overlay enabled, both the primary tile outlines (red) AND the per-band secondary tile outlines + labels render — confirms the _renderExtraSubLayers hook is wired correctly
  • Pan/zoom triggers re-fetches; signal aborts in-flight fetches when toggling sources

🤖 Generated with Claude Code

kylebarron and others added 3 commits May 1, 2026 12:02
Refs #417.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a protected hook returning [] by default. Subclasses (next commit:
MultiCOGLayer) override it to render per-tile overlays that depend on the
fetched DataT, without overriding _renderSubLayers itself.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drops ~165 lines of duplicated wiring (globe/mercator branching, signal
combining, RasterLayer construction, RasterTileset2D factory subclass)
that RasterTileLayer already provides. Multi-source fetch + stitch logic
stays in _getTileData (now consuming options.signal); rich per-band debug
overlay moves to the new _renderExtraSubLayers hook on the base class.
Public API unchanged.

Refs #417.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant