@eodash/eodash 5.0.0-alpha.2.18 → 5.0.0-alpha.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/core/client/App.vue +11 -1
  2. package/core/client/asWebComponent.js +9 -2
  3. package/core/client/composables/EodashMap.js +83 -97
  4. package/core/client/eodash.js +25 -4
  5. package/core/client/store/Actions.js +6 -0
  6. package/core/client/utils/createLayers.js +25 -10
  7. package/core/client/utils/eodashSTAC.js +13 -5
  8. package/core/client/utils/helpers.js +3 -3
  9. package/core/client/views/Dashboard.vue +17 -46
  10. package/dist/client/DashboardLayout-CPIA_V5h.js +86 -0
  11. package/dist/client/DynamicWebComponent-Bm2S0izi.js +88 -0
  12. package/dist/client/EodashDatePicker-Tdk5Xx9F.js +393 -0
  13. package/dist/client/EodashItemFilter-BUyqlf5G.js +194 -0
  14. package/dist/client/EodashLayerControl-DRYy-Air.js +111 -0
  15. package/dist/client/EodashMap-B_F51bLD.js +472 -0
  16. package/dist/client/EodashMapBtns-COBF3RhH.js +66 -0
  17. package/dist/client/ExportState-DkDHsbWL.js +644 -0
  18. package/dist/client/Footer-D8rQVlJH.js +141 -0
  19. package/dist/client/Header-CasZzQOl.js +437 -0
  20. package/dist/client/IframeWrapper-BgM9aU8f.js +28 -0
  21. package/dist/client/MobileLayout-CukFMuL9.js +1210 -0
  22. package/dist/client/PopUp-BXrxWSQ4.js +382 -0
  23. package/dist/client/VImg-DB_1xaqP.js +384 -0
  24. package/dist/client/VMain-nLmJhfgS.js +43 -0
  25. package/dist/client/VOverlay-naLhQSyZ.js +1453 -0
  26. package/dist/client/WidgetsContainer-CQY2xBg1.js +83 -0
  27. package/dist/client/asWebComponent-CIm1IGNl.js +11556 -0
  28. package/dist/client/eo-dash.js +2 -6
  29. package/dist/client/forwardRefs-q4ZkKtOv.js +245 -0
  30. package/dist/client/index-D-kMSCQA.js +199 -0
  31. package/dist/client/ssrBoot-BP7SYRyC.js +22 -0
  32. package/dist/client/style.css +2 -2
  33. package/dist/client/transition-DKGepKqs.js +37 -0
  34. package/dist/node/cli.js +5 -5
  35. package/dist/node/types.d.ts +2 -0
  36. package/package.json +25 -23
  37. package/widgets/EodashDatePicker.vue +20 -9
  38. package/widgets/EodashLayerControl.vue +21 -4
  39. package/core/client/SuspensedDashboard.ce.vue +0 -105
  40. package/dist/client/DashboardLayout-Dk6lzKZA.js +0 -156
  41. package/dist/client/DynamicWebComponent-BkMCGU7a.js +0 -57
  42. package/dist/client/EodashDatePicker-D27wn0jP.js +0 -276
  43. package/dist/client/EodashItemFilter-DS1mOc2p.js +0 -7651
  44. package/dist/client/EodashLayerControl-BqGA6jbV.js +0 -24534
  45. package/dist/client/EodashMap-BnVrfBnA.js +0 -88027
  46. package/dist/client/EodashMapBtns-rv-U1nI_.js +0 -50
  47. package/dist/client/ExportState-C3Z1ET5c.js +0 -571
  48. package/dist/client/Footer-BBkNiqPm.js +0 -117
  49. package/dist/client/Header-BQKHLO5P.js +0 -350
  50. package/dist/client/IframeWrapper-BX4e2uxq.js +0 -19
  51. package/dist/client/MobileLayout-C2aqobN5.js +0 -947
  52. package/dist/client/PopUp-DG3zrW12.js +0 -300
  53. package/dist/client/VImg-BLpHACcB.js +0 -293
  54. package/dist/client/VMain-DOyRcpub.js +0 -38
  55. package/dist/client/VOverlay-DAiInZQP.js +0 -973
  56. package/dist/client/WidgetsContainer-BqoX7R5Z.js +0 -129
  57. package/dist/client/asWebComponent-tNU8_fkz.js +0 -24518
  58. package/dist/client/basedecoder-DHcBySSe-BmCFNFnw.js +0 -88
  59. package/dist/client/decoder-DJlmx386-DJlmx386.js +0 -8
  60. package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +0 -10
  61. package/dist/client/eox-stacinfo-l7ALSV90.js +0 -13969
  62. package/dist/client/forwardRefs-BexjzXbg.js +0 -185
  63. package/dist/client/index-F73os72i.js +0 -153
  64. package/dist/client/jpeg-BAgeD1d3-oeHbFPUL.js +0 -514
  65. package/dist/client/lerc-B4lXefGh-DhdntrgS.js +0 -1027
  66. package/dist/client/lzw-LAGDNbSC-DkP96qO9.js +0 -84
  67. package/dist/client/packbits-BlDR4Kj5-C66n1-zr.js +0 -24
  68. package/dist/client/pako.esm-CB1uQYY0-DB0PYm1P.js +0 -1081
  69. package/dist/client/raw-CMGvRjfu-BRi6E4i1.js +0 -9
  70. package/dist/client/ssrBoot-C71RpKe4.js +0 -17
  71. package/dist/client/transition-DNdd2Y-1.js +0 -34
  72. package/dist/client/webfontloader-C7dpDL7m.js +0 -435
  73. package/dist/client/webimage-BM_pbLN3-L2cGWK5l.js +0 -19
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <v-app>
3
3
  <Suspense>
4
- <Dashboard />
4
+ <Dashboard :is-web-component="isWebComponent" :config="config" />
5
5
 
6
6
  <template #fallback>
7
7
  <ErrorAlert v-model="error" />
@@ -15,9 +15,19 @@ import Dashboard from "@/views/Dashboard.vue";
15
15
  import ErrorAlert from "./components/ErrorAlert.vue";
16
16
  import { onErrorCaptured, ref } from "vue";
17
17
 
18
+ defineProps({
19
+ config: {
20
+ type: String,
21
+ required: false,
22
+ default: undefined,
23
+ },
24
+ });
25
+
18
26
  // window.setEodashLoglevel("DEBUG")
19
27
 
20
28
  const error = ref("");
29
+ const isWebComponent = !!document.querySelector("eo-dash");
30
+
21
31
  onErrorCaptured((e, inst, info) => {
22
32
  error.value = `
23
33
  ${e}.
@@ -1,7 +1,14 @@
1
- import SuspensedDashboard from "./SuspensedDashboard.ce.vue";
1
+ import App from "./App.vue";
2
2
  import { defineCustomElement } from "vue";
3
+ import { registerPlugins } from "./plugins";
4
+
3
5
  /** @type {import("./asWebComponent").EodashConstructor} */
4
- export const Eodash = defineCustomElement(SuspensedDashboard);
6
+ export const Eodash = defineCustomElement(App, {
7
+ shadowRoot: false,
8
+ configureApp(app) {
9
+ registerPlugins(app);
10
+ },
11
+ });
5
12
 
6
13
  export function register() {
7
14
  customElements.define("eo-dash", Eodash);
@@ -2,7 +2,6 @@ import { EodashCollection } from "@/utils/eodashSTAC";
2
2
  import { setMapProjFromCol } from "@/utils/helpers";
3
3
  import { onMounted, onUnmounted, watch } from "vue";
4
4
  import log from "loglevel";
5
- import { datetime } from "@/store/States";
6
5
  import { useSTAcStore } from "@/store/stac";
7
6
  import { storeToRefs } from "pinia";
8
7
 
@@ -48,67 +47,27 @@ export const useHandleMapMoveEnd = (mapElement, mapPosition) => {
48
47
  };
49
48
 
50
49
  /**
51
- * Adds data layers extracted from eodash collections to Analysis Group
52
- *
53
- * @param { Record<string,any>[] | undefined} layersCollection
50
+ * Creates full layer configuration from indicator and time information
51
+ * @param {import("stac-ts").StacCatalog
52
+ * | import("stac-ts").StacCollection
53
+ * | import("stac-ts").StacItem
54
+ * | null
55
+ * } selectedIndicator
54
56
  * @param {EodashCollection[]} eodashCols
55
57
  * @param {string} [updatedTime]
56
58
  */
57
- const updateLayersConfig = async (
58
- layersCollection,
59
+
60
+ const createLayersConfig = async (
61
+ selectedIndicator,
59
62
  eodashCols,
60
63
  updatedTime,
61
64
  ) => {
62
65
  log.debug(
63
- "Updating layer configuration",
64
- layersCollection,
66
+ "Creating layers config",
67
+ selectedIndicator,
65
68
  eodashCols,
66
69
  updatedTime,
67
70
  );
68
- const dataLayersGroup = layersCollection?.find(
69
- (lyr) => lyr?.properties.id === "AnalysisGroup",
70
- );
71
- /** @type {Record<string,any>[]} */
72
- const analysisLayers = [];
73
-
74
- if (!dataLayersGroup) {
75
- log.debug("no AnalysisGroup layer found to be updated");
76
- return layersCollection;
77
- }
78
-
79
- for (const ec of eodashCols) {
80
- let layers;
81
- if (updatedTime) {
82
- layers = await ec.createLayersJson(new Date(updatedTime));
83
- } else {
84
- layers = await ec.createLayersJson();
85
- }
86
-
87
- if (layers) {
88
- analysisLayers.push(...layers);
89
- }
90
- }
91
- // Add expand to all analysis layers
92
- analysisLayers.forEach((dl) => {
93
- dl.properties.layerControlExpand = true;
94
- dl.properties.layerControlToolsExpand = true;
95
- });
96
-
97
- dataLayersGroup.layers = analysisLayers;
98
-
99
- return layersCollection;
100
- };
101
-
102
- /**
103
- * @param {import("stac-ts").StacCatalog
104
- * | import("stac-ts").StacCollection
105
- * | import("stac-ts").StacItem
106
- * | null
107
- * } selectedIndicator
108
- */
109
-
110
- const createLayersConfig = async (selectedIndicator) => {
111
- log.debug("Creating layers config", selectedIndicator);
112
71
  const layersCollection = [];
113
72
  const dataLayers = {
114
73
  type: "Group",
@@ -120,6 +79,21 @@ const createLayersConfig = async (selectedIndicator) => {
120
79
  layers: /** @type {Record<string,any>[]}*/ ([]),
121
80
  };
122
81
 
82
+ for (const ec of eodashCols) {
83
+ let layers;
84
+ if (updatedTime) {
85
+ layers = await ec.createLayersJson(new Date(updatedTime));
86
+ } else {
87
+ layers = await ec.createLayersJson();
88
+ }
89
+ // Add expand to all analysis layers
90
+ layers.forEach((dl) => {
91
+ dl.properties.layerControlExpand = true;
92
+ dl.properties.layerControlToolsExpand = true;
93
+ });
94
+ dataLayers.layers.push(...layers);
95
+ }
96
+
123
97
  layersCollection.push(dataLayers);
124
98
  const indicatorLayers =
125
99
  //@ts-expect-error indicator is collection
@@ -215,18 +189,6 @@ const createLayersConfig = async (selectedIndicator) => {
215
189
  layersCollection.unshift(overlayLayers);
216
190
  }
217
191
 
218
- // We try to set the current time selection
219
- // to latest extent date
220
- // @ts-expect-error it seems the temporal extent is not defined in type
221
- const interval = selectedIndicator?.extent?.temporal?.interval;
222
- if (interval && interval.length > 0 && interval[0].length > 1) {
223
- const endInterval = new Date(interval[0][1]);
224
- log.debug(
225
- "Datepicker: found stac extent, setting time to latest value",
226
- endInterval,
227
- );
228
- datetime.value = endInterval.toISOString();
229
- }
230
192
  return layersCollection;
231
193
  };
232
194
 
@@ -260,19 +222,21 @@ export const useInitMap = (
260
222
  [selectedIndicator, datetime],
261
223
  async ([updatedStac, updatedTime], [previousStac, previousTime]) => {
262
224
  if (updatedStac) {
225
+ log.debug(
226
+ "Selected Indicator watch triggered",
227
+ updatedStac,
228
+ updatedTime,
229
+ );
230
+
263
231
  if (mapElement?.value?.id === "main") {
264
232
  // Making sure main map gets the viewer that seems to be
265
233
  // removed when the second map is no longer rendered
266
234
  if (viewHolder !== null) {
235
+ // Set view to previous compare view
267
236
  mapElement?.value?.map.setView(viewHolder);
268
237
  viewHolder = null;
269
238
  }
270
239
  }
271
- log.debug(
272
- "Selected Indicator watch triggered",
273
- updatedStac,
274
- updatedTime,
275
- );
276
240
  let layersCollection = [];
277
241
 
278
242
  const onlyTimeChanged =
@@ -286,20 +250,20 @@ export const useInitMap = (
286
250
  } else {
287
251
  // Compare map being initialized
288
252
  if (selectedCompareStac.value !== null) {
289
- // save old view to set later
253
+ // save view of compare map
290
254
  viewHolder = mapElement?.value?.map.getView();
291
255
  /** @type {any} */
292
256
  (mapElement.value).sync = partnerMap.value;
293
257
  }
294
258
  }
295
259
 
260
+ // We re-crate the configuration if time changed
296
261
  if (onlyTimeChanged) {
297
- layersCollection =
298
- (await updateLayersConfig(
299
- [...(mapElement.value?.layers ?? [])].reverse(),
300
- eodashCols,
301
- updatedTime,
302
- )) ?? [];
262
+ layersCollection = await createLayersConfig(
263
+ updatedStac,
264
+ eodashCols,
265
+ updatedTime,
266
+ );
303
267
  log.debug(
304
268
  "Assigned layers after changing time only",
305
269
  JSON.parse(JSON.stringify(layersCollection)),
@@ -309,28 +273,50 @@ export const useInitMap = (
309
273
  }
310
274
 
311
275
  /** @type {Record<string,any>[]} */
312
- layersCollection = await createLayersConfig(updatedStac);
313
-
314
- // updates layersCollection in place
315
- await updateLayersConfig(layersCollection, eodashCols, updatedTime);
316
-
317
- // Try to move map view to extent
318
- // Sanitize extent,
319
- const b = updatedStac.extent?.spatial.bbox[0];
320
- const sanitizedExtent = [
321
- b[0] > -180 ? b[0] : -180,
322
- b[1] > -90 ? b[1] : -90,
323
- b[2] < 180 ? b[2] : 180,
324
- b[3] < 90 ? b[3] : 90,
325
- ];
326
-
327
- const reprojExtent = mapElement.value?.transformExtent(
328
- sanitizedExtent,
329
- "EPSG:4326",
330
- mapElement.value?.map?.getView().getProjection(),
276
+ layersCollection = await createLayersConfig(
277
+ updatedStac,
278
+ eodashCols,
279
+ datetime.value,
331
280
  );
332
- /** @type {any} */
333
- (mapElement.value).zoomExtent = reprojExtent;
281
+
282
+ // We try to set the current time selection to latest extent date
283
+ let endInterval = null;
284
+ const interval = updatedStac?.extent?.temporal?.interval;
285
+ if (interval && interval.length > 0 && interval[0].length > 1) {
286
+ // @ts-expect-error this is the defined STAC structure
287
+ endInterval = new Date(interval[0][1]);
288
+ log.debug(
289
+ "Indicator load: found stac extent, setting time to latest value",
290
+ endInterval,
291
+ );
292
+ }
293
+ if (
294
+ endInterval !== null &&
295
+ endInterval.toISOString() !== datetime.value
296
+ ) {
297
+ datetime.value = endInterval.toISOString();
298
+ }
299
+
300
+ // Try to move map view to extent only when main
301
+ // indicator and map changes
302
+ if (mapElement?.value?.id === "main") {
303
+ // Sanitize extent,
304
+ const b = updatedStac.extent?.spatial.bbox[0];
305
+ const sanitizedExtent = [
306
+ b[0] > -180 ? b[0] : -180,
307
+ b[1] > -90 ? b[1] : -90,
308
+ b[2] < 180 ? b[2] : 180,
309
+ b[3] < 90 ? b[3] : 90,
310
+ ];
311
+
312
+ const reprojExtent = mapElement.value?.transformExtent(
313
+ sanitizedExtent,
314
+ "EPSG:4326",
315
+ mapElement.value?.map?.getView().getProjection(),
316
+ );
317
+ /** @type {any} */
318
+ (mapElement.value).zoomExtent = reprojExtent;
319
+ }
334
320
 
335
321
  log.debug(
336
322
  "Assigned layers",
@@ -10,7 +10,8 @@ import { currentUrl } from "./store/States";
10
10
  export const eodash = reactive({
11
11
  id: "demo",
12
12
  stacEndpoint:
13
- "https://eodashcatalog.eox.at/test-style/trilateral/catalog.json",
13
+ // "https://eodashcatalog.eox.at/test-style/trilateral/catalog.json",
14
+ "https://gtif-cerulean.github.io/catalog/cerulean/catalog.json",
14
15
  brand: {
15
16
  noLayout: true,
16
17
  name: "Demo",
@@ -45,7 +46,7 @@ export const eodash = reactive({
45
46
  widget: {
46
47
  name: "EodashMap",
47
48
  properties: {
48
- // enableCompare: true,
49
+ enableCompare: true,
49
50
  },
50
51
  },
51
52
  },
@@ -58,7 +59,7 @@ export const eodash = reactive({
58
59
  widget: {
59
60
  name: "EodashItemFilter",
60
61
  properties: {
61
- // enableCompare: true,
62
+ enableCompare: true,
62
63
  aggregateResults: "collection_group",
63
64
  },
64
65
  },
@@ -72,13 +73,33 @@ export const eodash = reactive({
72
73
  name: "EodashLayerControl",
73
74
  },
74
75
  },
76
+ /*
77
+ {
78
+ defineWidget: (selectedCompareStac) => {
79
+ return selectedCompareStac
80
+ ? {
81
+ id: Symbol(),
82
+ title: "Layer Control Comparison",
83
+ layout: { x: 9, y: 6, w: 3, h: 6 },
84
+ type: "internal",
85
+ widget: {
86
+ name: "EodashLayerControl",
87
+ properties: {
88
+ map: "second",
89
+ },
90
+ },
91
+ }
92
+ : null;
93
+ },
94
+ },
95
+ */
75
96
  {
76
97
  defineWidget: (selectedSTAC) => {
77
98
  return selectedSTAC
78
99
  ? {
79
100
  id: "Information",
80
101
  title: "Information",
81
- layout: { x: 9, y: 0, w: 3, h: 12 },
102
+ layout: { x: 9, y: 0, w: 3, h: 6 },
82
103
  type: "web-component",
83
104
  widget: {
84
105
  link: async () => await import("@eox/stacinfo"),
@@ -8,6 +8,12 @@ import log from "loglevel";
8
8
  */
9
9
  export const getLayers = () => mapEl.value?.layers.toReversed();
10
10
 
11
+ /**
12
+ * Returns the current layers of {@link mapCompareEl}
13
+ * @returns {Record<string,any>[]}
14
+ */
15
+ export const getCompareLayers = () => mapCompareEl.value?.layers.toReversed();
16
+
11
17
  /**
12
18
  * Register EPSG projection in `eox-map`
13
19
  * @param {string|number|{name: string, def: string, extent?:number[]}} [projection]*/
@@ -1,4 +1,5 @@
1
1
  import { registerProjection } from "@/store/Actions";
2
+ import { mapEl } from "@/store/States";
2
3
  import {
3
4
  extractRoles,
4
5
  getProjectionCode,
@@ -116,6 +117,10 @@ export const createLayersFromLinks = async (
116
117
  const wmtsArray = item.links.filter((l) => l.rel === "wmts");
117
118
  const xyzArray = item.links.filter((l) => l.rel === "xyz") ?? [];
118
119
 
120
+ // Taking projection code from main map view, as main view defines
121
+ // projection for comparison map
122
+ const viewProjectionCode = mapEl?.value?.projection || "EPSG:3857";
123
+
119
124
  for (const wmsLink of wmsArray ?? []) {
120
125
  // Registering setting sub wms link projection
121
126
 
@@ -124,12 +129,16 @@ export const createLayersFromLinks = async (
124
129
  (wmsLink?.["proj:epsg"] || wmsLink?.["eodash:proj4_def"]);
125
130
 
126
131
  await registerProjection(wmsLinkProjection);
127
- const projectionCode = getProjectionCode(wmsLinkProjection || "EPSG:4326");
132
+
133
+ const linkProjectionCode =
134
+ getProjectionCode(wmsLinkProjection) || "EPSG:4326";
135
+ // Projection code need to be based on map view projection to make sure
136
+ // tiles are reloaded when changing projection
128
137
  const linkId = createLayerID(
129
138
  collectionId,
130
139
  item.id,
131
140
  wmsLink,
132
- projectionCode,
141
+ viewProjectionCode,
133
142
  );
134
143
  log.debug("WMS Layer added", linkId);
135
144
  let json = {
@@ -142,7 +151,7 @@ export const createLayersFromLinks = async (
142
151
  source: {
143
152
  type: "TileWMS",
144
153
  url: wmsLink.href,
145
- projection: projectionCode,
154
+ projection: linkProjectionCode,
146
155
  tileGrid: {
147
156
  tileSize: [512, 512],
148
157
  },
@@ -181,8 +190,14 @@ export const createLayersFromLinks = async (
181
190
  collectionId,
182
191
  item.id,
183
192
  wmtsLink,
184
- projectionCode,
193
+ viewProjectionCode,
185
194
  );
195
+ const dimensions = /** @type { {style:any} & Record<string,any> } */ (
196
+ wmtsLink["wmts:dimensions"] || {}
197
+ );
198
+ let { style, ...dimensionsWithoutStyle } = { ...dimensions };
199
+ let extractedStyle = /** @type { string } */ (style || "default");
200
+
186
201
  if (wmtsLink.title === "wmts capabilities") {
187
202
  log.debug(
188
203
  "Warning: WMTS Layer from capabilities added, function needs to be updated",
@@ -200,14 +215,14 @@ export const createLayersFromLinks = async (
200
215
  // TODO: Hard coding url as the current one set is for capabilities
201
216
  url: "https://wmts.marine.copernicus.eu/teroWmts",
202
217
  layer: wmtsLink["wmts:layer"],
203
- style: wmtsLink.style || "default",
218
+ style: extractedStyle,
204
219
  // TODO: Hard coding matrixSet until we find solution to wmts creation from capabilities
205
220
  matrixSet: "EPSG:3857",
206
221
  projection: projectionCode,
207
222
  tileGrid: {
208
223
  tileSize: [128, 128],
209
224
  },
210
- dimensions: wmtsLink["wmts:dimensions"],
225
+ dimensions: dimensionsWithoutStyle,
211
226
  },
212
227
  };
213
228
  } else {
@@ -224,15 +239,15 @@ export const createLayersFromLinks = async (
224
239
  },
225
240
  source: {
226
241
  type: "WMTS",
227
- url: wmtsLink,
242
+ url: wmtsLink.href,
228
243
  layer: wmtsLink["wmts:layer"],
229
- style: wmtsLink.style || "default",
244
+ style: extractedStyle,
230
245
  matrixSet: wmtsLink.matrixSet || "EPSG:3857",
231
246
  projection: projectionCode,
232
247
  tileGrid: {
233
248
  tileSize: [512, 512],
234
249
  },
235
- dimensions: wmtsLink["wmts:dimensions"],
250
+ dimensions: dimensionsWithoutStyle,
236
251
  },
237
252
  };
238
253
  }
@@ -251,7 +266,7 @@ export const createLayersFromLinks = async (
251
266
  collectionId,
252
267
  item.id,
253
268
  xyzLink,
254
- projectionCode,
269
+ viewProjectionCode,
255
270
  );
256
271
  log.debug("XYZ Layer added", linkId);
257
272
  let json = {
@@ -9,7 +9,11 @@ import {
9
9
  generateFeatures,
10
10
  replaceLayer,
11
11
  } from "./helpers";
12
- import { getLayers, registerProjection } from "@/store/Actions";
12
+ import {
13
+ getLayers,
14
+ getCompareLayers,
15
+ registerProjection,
16
+ } from "@/store/Actions";
13
17
  import { createLayersFromAssets, createLayersFromLinks } from "./createLayers";
14
18
  import axios from "@/plugins/axios";
15
19
  import log from "loglevel";
@@ -305,8 +309,9 @@ export class EodashCollection {
305
309
  *
306
310
  * @param {string} datetime
307
311
  * @param {string} layer
312
+ * @param {string} map
308
313
  */
309
- async updateLayerJson(datetime, layer) {
314
+ async updateLayerJson(datetime, layer, map) {
310
315
  await this.fetchCollection();
311
316
 
312
317
  // get the link of the specified date
@@ -327,12 +332,15 @@ export class EodashCollection {
327
332
  // create json layers from the item
328
333
  const newLayers = await this.createLayersJson(specifiedLink);
329
334
 
330
- const curentLayers = getLayers();
335
+ let currentLayers = getLayers();
336
+ if (map === "second") {
337
+ currentLayers = getCompareLayers();
338
+ }
331
339
 
332
- const oldLayer = findLayer(curentLayers, layer);
340
+ const oldLayer = findLayer(currentLayers, layer);
333
341
 
334
342
  const updatedLayers = replaceLayer(
335
- curentLayers,
343
+ currentLayers,
336
344
  /** @type {Record<string,any> & { properties:{ id:string; title:string } } } */
337
345
  (oldLayer),
338
346
  newLayers,
@@ -141,9 +141,9 @@ export const extractRoles = (properties, linkOrAsset) => {
141
141
  properties.group = role;
142
142
  //remove all the properties and replace the random ID with baselayer
143
143
  // provided ID
144
- const [_colId, _itemId, _isAsset, _random, proj] =
145
- properties.id.split(";:;");
146
- properties.id = ["", "", "", "", linkOrAsset.id, proj].join(";:;");
144
+ // const [_colId, _itemId, _isAsset, _random, proj] =
145
+ // properties.id.split(";:;");
146
+ // properties.id = ["", "", "", "", linkOrAsset.id, proj].join(";:;");
147
147
  }
148
148
 
149
149
  return properties;
@@ -1,26 +1,23 @@
1
1
  <template>
2
- <HeaderComponent ref="headerRef" v-if="!eodash.brand.noLayout" />
2
+ <HeaderComponent v-if="!eodash.brand.noLayout" />
3
3
  <ErrorAlert v-model="error" />
4
4
  <Suspense>
5
- <TemplateComponent
6
- @vue:mounted="onTemplateMount?.(hiddenElements)"
7
- class="template"
8
- />
5
+ <TemplateComponent :style="{ height: templateHeight }" />
9
6
  <template #fallback>
10
7
  <div class="loading-container">
11
8
  <Loading />
12
9
  </div>
13
10
  </template>
14
11
  </Suspense>
15
- <FooterComponent ref="footerRef" v-if="!eodash.brand.noLayout" />
12
+ <FooterComponent v-if="!eodash.brand.noLayout" />
16
13
  </template>
17
14
 
18
15
  <script setup>
19
16
  import { useEodashRuntime } from "@/composables/DefineEodash";
20
17
  import { useURLSearchParametersSync, useUpdateTheme } from "@/composables";
21
18
  import { useSTAcStore } from "@/store/stac";
22
- import { defineAsyncComponent, onErrorCaptured, onMounted, ref } from "vue";
23
- import { useDisplay, useLayout } from "vuetify/lib/framework.mjs";
19
+ import { defineAsyncComponent, onErrorCaptured, ref } from "vue";
20
+ import { useDisplay } from "vuetify/lib/framework.mjs";
24
21
  import { loadFont } from "@/utils";
25
22
  import Loading from "@/components/Loading.vue";
26
23
  import ErrorAlert from "@/components/ErrorAlert.vue";
@@ -29,8 +26,9 @@ const props = defineProps({
29
26
  config: {
30
27
  type: String,
31
28
  },
32
- onTemplateMount: {
33
- type: Function,
29
+ isWebComponent: {
30
+ type: Boolean,
31
+ default: false,
34
32
  },
35
33
  });
36
34
  const eodash = await useEodashRuntime(props.config);
@@ -43,7 +41,7 @@ theme.global.name.value = "dashboardTheme";
43
41
  await loadFont(
44
42
  eodash.brand?.font?.family,
45
43
  eodash.brand?.font?.link,
46
- !!props.onTemplateMount,
44
+ props.isWebComponent,
47
45
  );
48
46
 
49
47
  const { loadSTAC } = useSTAcStore();
@@ -60,34 +58,8 @@ const HeaderComponent = defineAsyncComponent(
60
58
  const FooterComponent = defineAsyncComponent(
61
59
  () => import(`@/components/Footer.vue`),
62
60
  );
63
- const { mainRect } = useLayout();
64
- const templateHeight = eodash.brand.noLayout
65
- ? props.onTemplateMount
66
- ? "100%"
67
- : "90dvh"
68
- : `calc(100dvh - ${mainRect.value["top"] + mainRect.value["bottom"]}px)`;
69
61
 
70
- const headerRef = ref(null);
71
- /**
72
- * @type {import("vue").Ref<InstanceType<
73
- * typeof import("@/components/Footer.vue").default
74
- * > | null>}
75
- */
76
- const footerRef = ref(null);
77
-
78
- const hiddenElements = [headerRef, footerRef];
79
-
80
- onMounted(() => {
81
- if (props.onTemplateMount && !eodash.brand.noLayout) {
82
- hiddenElements.forEach((element) => {
83
- /** @type {HTMLElement} */
84
- (
85
- /** @type {import("vue").ComponentPublicInstance} */
86
- (element.value).$el
87
- ).style.opacity = "0";
88
- });
89
- }
90
- });
62
+ const templateHeight = props.isWebComponent ? "100%" : "100dvh";
91
63
 
92
64
  const error = ref("");
93
65
  onErrorCaptured((e, comp, info) => {
@@ -99,18 +71,17 @@ onErrorCaptured((e, comp, info) => {
99
71
  });
100
72
  </script>
101
73
  <style>
102
- html {
103
- overflow: hidden !important;
104
- }
105
-
106
- .template {
107
- height: v-bind("templateHeight");
108
- }
109
-
110
74
  .loading-container {
111
75
  height: 100dvh;
112
76
  display: flex;
113
77
  align-items: center;
114
78
  justify-content: center;
115
79
  }
80
+
81
+ div.v-application__wrap {
82
+ min-height: fit-content;
83
+ }
84
+ eo-dash {
85
+ overflow: hidden;
86
+ }
116
87
  </style>