Skip to content

Commit 2cf0da6

Browse files
feat: GeoZarr source (#2040)
* feat(WIP): geoZarr * chore(deps): use ol dev package * chore(deps): add zarrita package * chore: update story * chore(deps): update package-lock * chore(docs): update map view
1 parent a1c7d7d commit 2cf0da6

File tree

5 files changed

+63
-0
lines changed

5 files changed

+63
-0
lines changed

elements/map/src/layers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export type OLAdvancedSources = {
5757
CartoDB: typeof import("ol/source/CartoDB").default;
5858
DataTile: typeof import("ol/source/DataTile").default;
5959
GeoTIFF: typeof import("ol/source/GeoTIFF").default;
60+
GeoZarr: typeof import("ol/source/GeoZarr").default;
6061
Google: typeof import("ol/source/Google").default;
6162
IIIF: typeof import("ol/source/IIIF").default;
6263
Image: typeof import("ol/source/Image").default;
@@ -176,6 +177,7 @@ export type EoxLayer =
176177
| EOxLayerType<"Vector", "Cluster">
177178
| EOxLayerType<"VectorTile", "VectorTile">
178179
| EOxLayerType<"WebGLTile", "GeoTIFF">
180+
| EOxLayerType<"WebGLTile", "GeoZarr">
179181
| EOxLayerType<"Tile", "OSM">
180182
| EOxLayerType<"Tile", "WMTSCapabilities">
181183
| EOxLayerType<"Tile", "StadiaMaps">

elements/map/src/plugins/advancedLayersAndSources/sources.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import BingMaps from "ol/source/BingMaps";
22
import CartoDB from "ol/source/CartoDB";
33
import DataTile from "ol/source/DataTile";
44
import GeoTIFF from "ol/source/GeoTIFF";
5+
import GeoZarr from "ol/source/GeoZarr";
56
import Google from "ol/source/Google";
67
import IIIF from "ol/source/IIIF";
78
import Image from "ol/source/Image";
@@ -37,6 +38,7 @@ window.eoxMapAdvancedOlSources = {
3738
Cluster,
3839
DataTile,
3940
GeoTIFF,
41+
GeoZarr,
4042
Google,
4143
IIIF,
4244
Image,
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* Renders `GeoZarr` layer as `WebGLTile`
3+
*
4+
* @returns {Object} The story configuration with arguments for the component.
5+
*/
6+
const GeoZarrLayerStory = {
7+
args: {
8+
center: [1407372, 5701616],
9+
layers: [
10+
{
11+
type: "Tile",
12+
properties: {
13+
id: "customId",
14+
},
15+
source: {
16+
type: "OSM",
17+
},
18+
},
19+
{
20+
type: "WebGLTile",
21+
properties: {
22+
id: "geozarrLayer",
23+
},
24+
source: {
25+
type: "GeoZarr",
26+
url: "https://s3.explorer.eopf.copernicus.eu/esa-zarr-sentinel-explorer-fra/tests-output/sentinel-2-l2a/S2A_MSIL2A_20251107T100231_N0511_R122_T32TQR_20251107T115310.zarr",
27+
group: "measurements/reflectance",
28+
bands: ["b04", "b03", "b02", "b05"],
29+
},
30+
style: {
31+
gamma: 1.5,
32+
color: [
33+
"color",
34+
["interpolate", ["linear"], ["band", 1], 0, 0, 0.5, 255],
35+
["interpolate", ["linear"], ["band", 2], 0, 0, 0.5, 255],
36+
["interpolate", ["linear"], ["band", 3], 0, 0, 0.5, 255],
37+
[
38+
"case",
39+
["==", ["+", ["band", 1], ["band", 2], ["band", 3]], 0],
40+
0,
41+
1,
42+
],
43+
],
44+
},
45+
},
46+
],
47+
zoom: 9,
48+
storyCodeBefore: `import "@eox/map/src/plugins/advancedLayersAndSources"`,
49+
},
50+
};
51+
52+
export default GeoZarrLayerStory;

elements/map/stories/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export { default as StaticImageLayerStory } from "./static-image";
88
export { default as STACLayerStory } from "./stac-layer";
99
export { default as MapboxStyleLayerStory } from "./mapbox-style-layer";
1010
export { default as GeoTIFFLayerStory } from "./geo-tiff-layer";
11+
export { default as GeoZarrLayerStory } from "./geo-zarr-layer";
1112
export { default as GroupLayerStory } from "./group-layer";
1213
export { default as ControlsStory } from "./controls";
1314
export { default as GeolocationStory } from "./geo-location";

elements/map/stories/map.stories.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
STACLayerStory,
1212
MapboxStyleLayerStory,
1313
GeoTIFFLayerStory,
14+
GeoZarrLayerStory,
1415
GroupLayerStory,
1516
ControlsStory,
1617
GeolocationStory,
@@ -193,6 +194,11 @@ export const MapboxStyleLayer = MapboxStyleLayerStory;
193194
*/
194195
export const GeoTIFFLayer = GeoTIFFLayerStory;
195196

197+
/**
198+
* Renders `GeoZarr` layer as `WebGLTile`
199+
*/
200+
export const GeoZarrLayer = GeoZarrLayerStory;
201+
196202
/**
197203
* Renders `Group` layer which contains multiple layers in a group
198204
*/

0 commit comments

Comments
 (0)