Skip to content

Add support for COG and Zarr#5

Merged
giswqs merged 4 commits intomainfrom
cog
Jan 20, 2026
Merged

Add support for COG and Zarr#5
giswqs merged 4 commits intomainfrom
cog

Conversation

@giswqs
Copy link
Copy Markdown
Member

@giswqs giswqs commented Jan 20, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 20, 2026 14:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +127 to +140
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);
}
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +150 to +163
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);
}
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@giswqs giswqs merged commit 22b3dc1 into main Jan 20, 2026
2 checks passed
@giswqs giswqs deleted the cog branch January 20, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants