Skip to content

Commit b282d3a

Browse files
Add storybooks for requesting findTiles() in different CRSs
1 parent 8d36b7d commit b282d3a

File tree

2 files changed

+66
-4
lines changed

2 files changed

+66
-4
lines changed

stories/s1grdiw.eocloud.stories.js

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
S1GRDEOCloudLayer,
33
CRS_EPSG3857,
4+
CRS_EPSG4326,
45
BBox,
56
MimeTypes,
67
ApiType,
@@ -23,6 +24,7 @@ if (!process.env.EOC_S1GRDIW_LAYER_ID) {
2324
const instanceId = process.env.EOC_INSTANCE_ID;
2425
const layerId = process.env.EOC_S1GRDIW_LAYER_ID;
2526
const bbox = new BBox(CRS_EPSG3857, 1487158.82, 5322463.15, 1565430.34, 5400734.67);
27+
const bbox4326 = new BBox(CRS_EPSG4326, 13.359375, 43.0688878, 14.0625, 43.5803908);
2628

2729
export default {
2830
title: 'Sentinel 1 GRD IW - EOCloud',
@@ -144,7 +146,7 @@ export const getMapWMSEvalscript = () => {
144146
return wrapperEl;
145147
};
146148

147-
export const findTiles = () => {
149+
export const findTilesEPSG3857 = () => {
148150
const layer = new S1GRDEOCloudLayer(
149151
instanceId,
150152
layerId,
@@ -159,7 +161,7 @@ export const findTiles = () => {
159161
const containerEl = document.createElement('pre');
160162

161163
const wrapperEl = document.createElement('div');
162-
wrapperEl.innerHTML = "<h2>findTiles</h2>";
164+
wrapperEl.innerHTML = "<h2>findTiles - BBox in EPSG:3857</h2>";
163165
wrapperEl.insertAdjacentElement("beforeend", containerEl);
164166

165167
const perform = async () => {
@@ -178,6 +180,40 @@ export const findTiles = () => {
178180
return wrapperEl;
179181
};
180182

183+
export const findTilesEPSG4326 = () => {
184+
const layer = new S1GRDEOCloudLayer(
185+
instanceId,
186+
layerId,
187+
null,
188+
null,
189+
null,
190+
null,
191+
AcquisitionMode.IW,
192+
Polarization.DV,
193+
OrbitDirection.ASCENDING,
194+
);
195+
const containerEl = document.createElement('pre');
196+
197+
const wrapperEl = document.createElement('div');
198+
wrapperEl.innerHTML = "<h2>findTiles - BBox in EPSG:4326</h2>";
199+
wrapperEl.insertAdjacentElement("beforeend", containerEl);
200+
201+
const perform = async () => {
202+
const data = await layer.findTiles(
203+
bbox4326,
204+
new Date(Date.UTC(2020, 1 - 1, 1, 0, 0, 0)),
205+
new Date(Date.UTC(2020, 1 - 1, 15, 23, 59, 59)),
206+
5,
207+
null,
208+
OrbitDirection.ASCENDING,
209+
);
210+
renderTilesList(containerEl, data.tiles);
211+
};
212+
perform().then(() => {});
213+
214+
return wrapperEl;
215+
};
216+
181217
function renderTilesList(containerEl, list) {
182218
list.forEach(tile => {
183219
const ul = document.createElement('ul');

stories/s1grdiw.stories.js

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,35 @@ export const getMapProcessingFromLayer = () => {
256256
return wrapperEl;
257257
};
258258

259-
export const findTiles = () => {
259+
export const findTilesEPSG3857 = () => {
260260
const layer = new S1GRDAWSEULayer(instanceId, layerId);
261-
const bbox = new BBox(CRS_EPSG4326, 11.9, 12.34, 42.05, 42.19);
261+
const bbox = new BBox(CRS_EPSG3857, 1487158.82, 5322463.15, 1565430.34, 5400734.67);
262+
const bbox4326 = new BBox(CRS_EPSG4326, 13.359375, 43.0688878, 14.0625, 43.5803908);
263+
const containerEl = document.createElement('pre');
264+
265+
const wrapperEl = document.createElement('div');
266+
wrapperEl.innerHTML = "<h2>findTiles</h2>";
267+
wrapperEl.insertAdjacentElement("beforeend", containerEl);
268+
269+
const perform = async () => {
270+
await setAuthTokenWithOAuthCredentials();
271+
const data = await layer.findTiles(
272+
bbox,
273+
new Date(Date.UTC(2020, 1 - 1, 1, 0, 0, 0)),
274+
new Date(Date.UTC(2020, 1 - 1, 15, 23, 59, 59)),
275+
5,
276+
0,
277+
);
278+
renderTilesList(containerEl, data.tiles);
279+
};
280+
perform().then(() => {});
281+
282+
return wrapperEl;
283+
};
284+
285+
export const findTilesEPSG4326 = () => {
286+
const layer = new S1GRDAWSEULayer(instanceId, layerId);
287+
const bbox = new BBox(CRS_EPSG4326, 13.359375, 43.0688878, 14.0625, 43.5803908);
262288
const containerEl = document.createElement('pre');
263289

264290
const wrapperEl = document.createElement('div');

0 commit comments

Comments
 (0)