Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds support for GPU-accelerated Cloud Optimized GeoTIFF (COG) layers and Zarr multi-dimensional array data layers to MapLibre GL Extend.
Changes:
- Adds GPU COG layer support via deck.gl for high-performance rendering of large raster datasets
- Adds Zarr layer support for multi-dimensional array data visualization (climate data, time series)
- Implements deck.gl overlay management system for custom GPU-accelerated layers
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds dependencies for deck.gl, zarr-layer, and related libraries |
| src/types.d.ts | Adds type definitions for new GPU COG and Zarr layer methods |
| src/lib/layers/deck-overlay.ts | Implements deck.gl overlay management for GPU layers |
| src/lib/layers/cog-layer-with-opacity.ts | COGLayer wrapper to properly handle opacity |
| src/lib/layers/gpu-cog.ts | GPU-accelerated COG layer implementation |
| src/lib/layers/zarr.ts | Zarr layer implementation with dynamic property updates |
| src/lib/layers/types.ts | Type definitions for GPU COG and Zarr options |
| src/lib/layers/management.ts | Integrates deck.gl and Zarr layers into layer management |
| src/lib/layers/index.ts | Exports new layer functions |
| src/lib/hooks/useMapExtend.tsx | Adds React hooks for new layer types |
| src/index.ts | Extends Map prototype with new methods |
| examples/cog/* | Working example for GPU COG layers |
| examples/zarr/* | Working example for Zarr layers |
| README.md | Documentation for new features |
| index.html | Updated landing page with new examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export function setDeckLayerVisibility(map: Map, layerId: string, visible: boolean): void { | ||
| const layers = getDeckLayers(map); | ||
| const entry = layers[layerId]; | ||
|
|
||
| if (entry && typeof entry.layer.clone === 'function') { | ||
| // Clone the layer with updated visibility | ||
| const updatedLayer = entry.layer.clone({ visible }); | ||
| layers[layerId] = { | ||
| ...entry, | ||
| layer: updatedLayer, | ||
| visible, | ||
| }; | ||
| updateDeckOverlay(map); | ||
| } |
There was a problem hiding this comment.
The missing call to setDeckLayers after updating the layer registry could lead to inconsistent state. After line 138, you should call setDeckLayers(map, layers) to persist the updated registry.
| export function setDeckLayerOpacity(map: Map, layerId: string, opacity: number): void { | ||
| const layers = getDeckLayers(map); | ||
| const entry = layers[layerId]; | ||
|
|
||
| if (entry && typeof entry.layer.clone === 'function') { | ||
| // Clone the layer with updated opacity | ||
| const updatedLayer = entry.layer.clone({ opacity }); | ||
| layers[layerId] = { | ||
| ...entry, | ||
| layer: updatedLayer, | ||
| opacity, | ||
| }; | ||
| updateDeckOverlay(map); | ||
| } |
There was a problem hiding this comment.
After updating the layer in the registry (line 160), setDeckLayers(map, layers) should be called to persist the state change consistently with other methods in this file.
No description provided.