What's Changed
Clip COG rendering to a GeoJSON mask
You can now restrict any COG layer to the area defined by a GeoJSON FeatureCollection of polygons — pixels outside are made transparent. Use setMask(geojson) to apply and clearMask() to remove. Useful for focusing on administrative boundaries, watersheds, or any arbitrary area of interest.
Internal COG masks are now respected
COGs that embed an alpha/mask band are now rendered correctly — masked-out pixels are transparent as intended. Previously those internal masks were ignored.
Better error reporting for unsupported projections
If a COG is in a projection other than EPSG:3857, the library now throws a clear error instead of silently producing wrong results. This makes it much easier to diagnose data preparation issues.
Dynamic custom color functions
The CustomRendererStore API gained a delete method, and setColorFunction now accepts undefined to remove a previously registered function. This makes it practical to swap or clear color logic at runtime — useful for interactive apps that change symbolization on user action.
Relevant merged PRs
- Upgrade geotiff to version 3.0.0 and fix breaking changes in the geotiff API. by @gunnasko in #34
- Add delete method to CustomRendererStore and support undefined in setColorFunction by @pcace in #38
- Add GeoJSON Masking by @oscarfonts and @bameyrick in #41
- Throw on unsupported COG projection. Closes #36 by @oscarfonts in #42
- Apply internal COG masks. Closes #28 by @oscarfonts in #44
New Contributors
Full Changelog: v0.8.0...v0.9.0