@@ -12,6 +12,8 @@ Extended functionality for MapLibre GL JS with convenient methods for basemaps,
1212- ** Basemap Support** : 35+ free basemap providers including OpenStreetMap, CartoDB, Esri, Google, Stadia, USGS, and more
1313- ** GeoJSON Layers** : Easy-to-use methods for adding GeoJSON data with auto-detection of geometry types
1414- ** Raster Layers** : Support for XYZ tile layers, WMS services, and Cloud Optimized GeoTIFFs (COG)
15+ - ** GPU COG Layers** : GPU-accelerated Cloud Optimized GeoTIFF rendering using deck.gl for large rasters
16+ - ** Zarr Layers** : Multi-dimensional array data visualization (climate data, satellite imagery time series)
1517- ** Layer Management** : Toggle visibility, adjust opacity, reorder layers, and more
1618- ** Map State** : Capture and restore complete map state (camera, style, terrain, sky, layers, controls)
1719- ** TypeScript First** : Full TypeScript support with module augmentation for type-safe Map methods
@@ -198,14 +200,71 @@ map.addWmsLayer('https://example.com/wms', {
198200 opacity: 0.7 ,
199201});
200202
201- // Add Cloud Optimized GeoTIFF
203+ // Add Cloud Optimized GeoTIFF (tile-based)
202204map .addCogLayer (' https://example.com/raster.tif' , {
203205 tileServerUrl: ' https://titiler.example.com' , // TiTiler server URL
204206 opacity: 0.9 ,
205207 bounds: [- 180 , - 90 , 180 , 90 ],
206208});
207209```
208210
211+ ### GPU COG Layers
212+
213+ For large Cloud Optimized GeoTIFFs, use GPU-accelerated rendering with deck.gl:
214+
215+ ``` typescript
216+ // Add GPU-accelerated COG layer
217+ const layerId = await map .addGpuCogLayer (' https://example.com/large-raster.tif' , {
218+ opacity: 0.8 ,
219+ fitBounds: true , // Automatically zoom to raster extent
220+ debug: false , // Show debug tiles
221+ debugOpacity: 0.25 , // Debug tile opacity
222+ maxError: 0.125 , // Maximum terrain mesh error
223+ });
224+
225+ // Control visibility and opacity
226+ map .setLayerVisibility (layerId , false );
227+ map .setLayerOpacity (layerId , 0.5 );
228+
229+ // Remove the layer
230+ map .removeLayerById (layerId );
231+ ```
232+
233+ ### Zarr Layers
234+
235+ Visualize multi-dimensional array data (e.g., climate data, satellite time series):
236+
237+ ``` typescript
238+ // Add Zarr layer
239+ const layerId = await map .addZarrLayer (
240+ ' https://carbonplan-maps.s3.us-west-2.amazonaws.com/v2/demo/4d/tavg-prec-month' ,
241+ {
242+ variable: ' tavg' , // Variable to display
243+ colormap: [' #440154' , ' #21918c' , ' #fde725' ], // Viridis-like colormap
244+ clim: [0 , 30 ], // Color limits [min, max]
245+ opacity: 0.8 ,
246+ selector: { month: 6 }, // Dimension selector
247+ fillValue: - 9999 , // No-data value
248+ }
249+ );
250+
251+ // Update dimension selector (e.g., change month)
252+ map .setZarrSelector (layerId , { month: 9 }); // October
253+
254+ // Update color limits
255+ map .setZarrClim (layerId , [- 10 , 40 ]);
256+
257+ // Update colormap
258+ map .setZarrColormap (layerId , [' #3b4cc0' , ' #f7f7f7' , ' #b40426' ]); // Coolwarm
259+
260+ // Control visibility and opacity
261+ map .setLayerVisibility (layerId , false );
262+ map .setLayerOpacity (layerId , 0.5 );
263+
264+ // Remove the layer
265+ map .removeZarrLayer (layerId );
266+ ```
267+
209268### Layer Management
210269
211270``` typescript
@@ -351,6 +410,11 @@ const {
351410 addRasterLayer,
352411 addCogLayer,
353412 addWmsLayer,
413+ addGpuCogLayer, // GPU-accelerated COG layers
414+ addZarrLayer, // Zarr multi-dimensional data
415+ setZarrSelector, // Update Zarr dimension selector
416+ setZarrClim, // Update Zarr color limits
417+ setZarrColormap, // Update Zarr colormap
354418 removeLayer,
355419 toggleLayerVisibility,
356420 setLayerOpacity,
@@ -398,6 +462,8 @@ import type {
398462 AddRasterOptions ,
399463 AddCogOptions ,
400464 AddWmsOptions ,
465+ AddGpuCogOptions ,
466+ AddZarrOptions ,
401467 LayerInfo ,
402468 // State types
403469 MapState ,
0 commit comments