@eodash/eodash 5.0.0 → 5.1.0

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 (155) hide show
  1. package/README.md +1 -0
  2. package/core/client/App.vue +8 -2
  3. package/core/client/asWebComponent.js +5 -5
  4. package/core/client/components/DashboardLayout.vue +42 -25
  5. package/core/client/components/EodashOverlay.vue +1 -1
  6. package/core/client/components/ErrorAlert.vue +2 -2
  7. package/core/client/components/Footer.vue +4 -4
  8. package/core/client/components/Header.vue +3 -3
  9. package/core/client/components/MobileLayout.vue +9 -10
  10. package/core/client/composables/DefineEodash.js +38 -43
  11. package/core/client/composables/DefineTemplate.js +4 -2
  12. package/core/client/composables/DefineWidgets.js +14 -8
  13. package/core/client/composables/index.js +273 -23
  14. package/core/client/eodashSTAC/EodashCollection.js +80 -47
  15. package/core/client/eodashSTAC/helpers.js +136 -27
  16. package/core/client/eodashSTAC/parquet.js +145 -0
  17. package/core/client/eodashSTAC/triggers.js +6 -3
  18. package/core/client/plugins/index.js +4 -3
  19. package/core/client/plugins/vuetify.js +3 -0
  20. package/core/client/store/actions.js +21 -4
  21. package/core/client/store/stac.js +93 -56
  22. package/core/client/store/states.js +15 -5
  23. package/core/client/types.ts +59 -43
  24. package/core/client/utils/index.js +79 -0
  25. package/core/client/utils/keys.js +2 -2
  26. package/core/client/utils/states.js +30 -5
  27. package/core/client/views/Dashboard.vue +36 -32
  28. package/core/client/vite-env.d.ts +7 -0
  29. package/dist/client/{DashboardLayout-CkWvOMOW.js → DashboardLayout-ByVs1DrY.js} +23 -12
  30. package/dist/client/{DynamicWebComponent-DYBbpvUK.js → DynamicWebComponent-C3W7HSQm.js} +1 -1
  31. package/dist/client/{EodashDatePicker-CALmW3SI.js → EodashDatePicker-BIAf1sMT.js} +59 -32
  32. package/dist/client/{EodashItemFilter-DlQiE713.js → EodashItemFilter-DPznh8UB.js} +20 -10
  33. package/dist/client/{EodashLayerControl-DEzEbft7.js → EodashLayerControl-Bhxjw4V2.js} +29 -16
  34. package/dist/client/EodashLayoutSwitcher-C5qTEffW.js +61 -0
  35. package/dist/client/EodashMapBtns-WoGq8MuV.js +173 -0
  36. package/dist/client/{EodashStacInfo-DPPxDkF6.js → EodashStacInfo-CSvvF2jI.js} +3 -18
  37. package/dist/client/{EodashTools-CUaL9s4H.js → EodashTools-Cv1SXQ5y.js} +13 -13
  38. package/dist/client/{ExportState-DjyIZVhl.js → ExportState-D-iuwaad.js} +58 -52
  39. package/dist/client/{Footer-DyL0JoWt.js → Footer-CyF0zRAk.js} +15 -13
  40. package/dist/client/{Header-B5Dgty9l.js → Header-CgD8jDKU.js} +33 -28
  41. package/dist/client/{MobileLayout-CRsg_5Q4.js → MobileLayout-EKQ_kpSh.js} +69 -60
  42. package/dist/client/{PopUp-BfB8s_ki.js → PopUp-BsYLvWch.js} +19 -10
  43. package/dist/client/ProcessList-C2xsLU2_.js +191 -0
  44. package/dist/client/{VImg-FD1WVphJ.js → VImg-OHe8YTs2.js} +24 -24
  45. package/dist/client/{VMain-DJKG4SvM.js → VMain-PryTLU4a.js} +7 -7
  46. package/dist/client/{VOverlay-BzOdRu9h.js → VOverlay-yUn7p-Uf.js} +64 -27
  47. package/dist/client/{VTooltip-CfeefrXI.js → VTooltip-DZ0fjpB3.js} +13 -10
  48. package/dist/client/{WidgetsContainer-C2TaTdb6.js → WidgetsContainer-B9LBadcC.js} +1 -1
  49. package/dist/client/asWebComponent-By_7_JjS.js +19193 -0
  50. package/dist/client/async-DkSu_u2K.js +740 -0
  51. package/dist/client/eo-dash.js +1 -1
  52. package/dist/client/{forwardRefs-Bon_Kku1.js → forwardRefs-BXxrv98s.js} +31 -4
  53. package/dist/client/handling-CgmFXkW6.js +1212 -0
  54. package/dist/client/helpers-Dy0Q13tP.js +4534 -0
  55. package/dist/client/{index-Bm9cbtx5.js → index-BuhOHXKv.js} +2 -4
  56. package/dist/client/{index-CIHH_3dW.js → index-Ch_HchK3.js} +39 -32
  57. package/dist/client/{index-4CT7Tz83.js → index-Dqj4tbx2.js} +2 -2
  58. package/dist/client/index-skjhlH8u.js +376 -0
  59. package/dist/client/{ssrBoot-BP7SYRyC.js → ssrBoot-Zgc_Ttvi.js} +2 -2
  60. package/dist/client/templates.js +850 -0
  61. package/dist/client/transition-C98Yn4Vo.js +40 -0
  62. package/dist/node/cli.js +16 -6
  63. package/dist/node/types.d.ts +1 -1
  64. package/dist/types/core/client/App.vue.d.ts +2 -2
  65. package/dist/types/core/client/asWebComponent.d.ts +1 -1
  66. package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +1 -3
  67. package/dist/types/core/client/components/Footer.vue.d.ts +1 -105
  68. package/dist/types/core/client/components/IframeWrapper.vue.d.ts +1 -1
  69. package/dist/types/core/client/components/MobileLayout.vue.d.ts +1 -324
  70. package/dist/types/core/client/composables/DefineEodash.d.ts +2 -2
  71. package/dist/types/core/client/composables/DefineTemplate.d.ts +1 -1
  72. package/dist/types/core/client/composables/DefineWidgets.d.ts +4 -4
  73. package/dist/types/core/client/composables/index.d.ts +24 -2
  74. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +9 -6
  75. package/dist/types/core/client/eodashSTAC/helpers.d.ts +20 -5
  76. package/dist/types/core/client/eodashSTAC/parquet.d.ts +2 -0
  77. package/dist/types/core/client/plugins/vuetify.d.ts +7 -4
  78. package/dist/types/core/client/store/actions.d.ts +3 -2
  79. package/dist/types/core/client/store/stac.d.ts +16 -13
  80. package/dist/types/core/client/store/states.d.ts +14 -4
  81. package/dist/types/core/client/types.d.ts +45 -30
  82. package/dist/types/core/client/utils/index.d.ts +2 -0
  83. package/dist/types/core/client/utils/keys.d.ts +4 -4
  84. package/dist/types/core/client/utils/states.d.ts +59 -47
  85. package/dist/types/core/client/views/Dashboard.vue.d.ts +2 -2
  86. package/dist/types/templates/baseConfig.d.ts +4 -0
  87. package/dist/types/templates/compare.d.ts +210 -0
  88. package/dist/types/templates/expert.d.ts +151 -0
  89. package/dist/types/templates/index.d.ts +6 -0
  90. package/dist/types/templates/light.d.ts +145 -0
  91. package/dist/types/widgets/EodashDatePicker.vue.d.ts +1 -458
  92. package/dist/types/widgets/EodashItemFilter.vue.d.ts +3 -3
  93. package/dist/types/widgets/EodashLayerControl.vue.d.ts +14 -7
  94. package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +1 -3
  95. package/dist/types/widgets/EodashMap/index.vue.d.ts +1 -4
  96. package/dist/types/widgets/EodashMapBtns.vue.d.ts +8 -8
  97. package/dist/types/widgets/EodashProcess/ProcessList.vue.d.ts +8 -1
  98. package/dist/types/widgets/EodashProcess/index.vue.d.ts +8 -4
  99. package/dist/types/widgets/EodashProcess/methods/async.d.ts +18 -18
  100. package/dist/types/widgets/EodashProcess/methods/composables.d.ts +3 -2
  101. package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/index.d.ts +1 -0
  102. package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.d.ts +6 -0
  103. package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.d.ts +4 -0
  104. package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.d.ts +5 -0
  105. package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/index.d.ts +1 -0
  106. package/dist/types/widgets/EodashProcess/methods/handling.d.ts +12 -5
  107. package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +72 -41
  108. package/dist/types/widgets/EodashProcess/methods/utils.d.ts +41 -21
  109. package/dist/types/widgets/EodashProcess/states.d.ts +11 -0
  110. package/dist/types/widgets/EodashProcess/types.d.ts +41 -0
  111. package/dist/types/widgets/EodashStacInfo.vue.d.ts +14 -14
  112. package/dist/types/widgets/EodashTools.vue.d.ts +3 -3
  113. package/dist/types/widgets/ExportState.vue.d.ts +1 -1
  114. package/dist/types/widgets/PopUp.vue.d.ts +11 -16
  115. package/dist/types/widgets/WidgetsContainer.vue.d.ts +3 -6
  116. package/package.json +53 -45
  117. package/templates/baseConfig.js +68 -0
  118. package/templates/compare.js +162 -0
  119. package/templates/expert.js +123 -0
  120. package/templates/index.js +8 -0
  121. package/templates/light.js +130 -0
  122. package/widgets/EodashDatePicker.vue +80 -31
  123. package/widgets/EodashItemFilter.vue +26 -11
  124. package/widgets/EodashLayerControl.vue +20 -11
  125. package/widgets/EodashLayoutSwitcher.vue +6 -3
  126. package/widgets/EodashMap/index.vue +3 -8
  127. package/widgets/EodashMap/methods/create-layers-config.js +4 -3
  128. package/widgets/EodashMap/methods/index.js +33 -23
  129. package/widgets/EodashMapBtns.vue +83 -41
  130. package/widgets/EodashProcess/ProcessList.vue +34 -10
  131. package/widgets/EodashProcess/index.vue +55 -20
  132. package/widgets/EodashProcess/methods/async.js +77 -59
  133. package/widgets/EodashProcess/methods/composables.js +21 -14
  134. package/widgets/EodashProcess/methods/custom-endpoints/chart/index.js +35 -0
  135. package/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.js +275 -0
  136. package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +116 -0
  137. package/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.js +94 -0
  138. package/widgets/EodashProcess/methods/custom-endpoints/layers/index.js +33 -0
  139. package/widgets/EodashProcess/methods/handling.js +127 -80
  140. package/widgets/EodashProcess/methods/outputs.js +376 -125
  141. package/widgets/EodashProcess/methods/utils.js +398 -10
  142. package/widgets/EodashProcess/states.js +13 -0
  143. package/widgets/EodashProcess/types.ts +46 -0
  144. package/widgets/EodashStacInfo.vue +2 -17
  145. package/widgets/EodashTools.vue +13 -13
  146. package/widgets/WidgetsContainer.vue +1 -1
  147. package/core/client/eodash.js +0 -454
  148. package/dist/client/EodashLayoutSwitcher-CDeCV8F-.js +0 -52
  149. package/dist/client/EodashMapBtns-CktQCfa-.js +0 -131
  150. package/dist/client/ProcessList-DTefwQZx.js +0 -484
  151. package/dist/client/asWebComponent-CLhcT715.js +0 -12479
  152. package/dist/client/eo-dash.css +0 -5
  153. package/dist/client/index-DiGDvTQU.js +0 -780
  154. package/dist/client/transition-C5I57hn6.js +0 -37
  155. package/dist/types/core/client/eodash.d.ts +0 -8
@@ -6,12 +6,12 @@
6
6
  :attributes="attributes"
7
7
  :masks="masks"
8
8
  expanded
9
- class="bg-surface overflow-auto"
9
+ class="overflow-auto"
10
10
  style="background-color: transparent; max-width: 100%"
11
11
  >
12
12
  <template v-if="toggleCalendar" #default="{ inputValue, inputEvents }">
13
13
  <div
14
- class="bg-surface d-flex flex-row align-center justify-center pb-1"
14
+ class="d-flex flex-row align-center justify-center pb-1"
15
15
  style="overflow: hidden; width: 100%"
16
16
  >
17
17
  <v-btn
@@ -22,7 +22,7 @@
22
22
  variant="text"
23
23
  @click="jumpDate(true)"
24
24
  class="py-2"
25
- style="flex-shrink: 1"
25
+ style="flex-shrink: 1; padding: 0"
26
26
  >
27
27
  <v-icon :icon="[mdiRayEndArrow]" />
28
28
  </v-btn>
@@ -52,7 +52,7 @@
52
52
  v-tooltip:bottom="'Set date to latest available dataset'"
53
53
  @click="jumpDate(false)"
54
54
  class="py-2"
55
- style="flex-shrink: 1"
55
+ style="flex-shrink: 1; padding: 0"
56
56
  >
57
57
  <v-icon :icon="[mdiRayStartArrow]" />
58
58
  </v-btn>
@@ -119,7 +119,6 @@ import {
119
119
  reactive,
120
120
  ref,
121
121
  customRef,
122
- toRef,
123
122
  onMounted,
124
123
  computed,
125
124
  useTemplateRef,
@@ -127,9 +126,11 @@ import {
127
126
  import { useSTAcStore } from "@/store/stac";
128
127
  import { datetime } from "@/store/states";
129
128
  import { mdiRayStartArrow, mdiRayEndArrow } from "@mdi/js";
130
- import { eodashCollections, collectionsPalette } from "@/utils/states";
129
+ import { eodashCollections, eodashCompareCollections } from "@/utils/states";
131
130
  import log from "loglevel";
132
- import { makePanelTransparent } from "@/composables";
131
+ import { useTransparentPanel } from "@/composables";
132
+ import { getDatetimeProperty } from "@/eodashSTAC/helpers";
133
+ import { storeToRefs } from "pinia";
133
134
 
134
135
  const { lgAndDown } = useDisplay();
135
136
 
@@ -214,24 +215,49 @@ defineProps({
214
215
  */
215
216
  const attributes = reactive([]);
216
217
 
217
- const selectedStac = toRef(useSTAcStore(), "selectedStac");
218
+ const { selectedCompareStac, selectedStac } = storeToRefs(useSTAcStore());
218
219
 
219
220
  watch(
220
- selectedStac,
221
- async (updatedStac, previousStac) => {
222
- if (updatedStac && previousStac?.id !== updatedStac.id) {
223
- log.debug("Datepicker selected STAC change triggered");
224
- // remove old values
225
- attributes.splice(0, attributes.length);
221
+ [selectedStac, selectedCompareStac],
222
+ async ([updatedStac, updatedCompareStac]) => {
223
+ attributes.splice(0, attributes.length);
224
+ if (!updatedStac && !updatedCompareStac) {
225
+ log.debug("No STAC selected, clearing datepicker attributes");
226
+ return;
227
+ }
228
+
229
+ const attrs =
230
+ /** @type {Partial<import("v-calendar/dist/types/src/utils/attribute").AttributeConfig>[]} */ ([
231
+ ...(await fetchCollectionsAttributes(eodashCollections)),
232
+ ...(await fetchCollectionsAttributes(eodashCompareCollections)),
233
+ ]);
234
+ attributes.push(...attrs);
235
+ },
236
+ { immediate: true },
237
+ );
226
238
 
227
- for (let idx = 0; idx < eodashCollections.length; idx++) {
228
- log.debug("Retrieving dates", eodashCollections[idx]);
229
- await eodashCollections[idx].fetchCollection();
239
+ /**
240
+ *
241
+ * @param {import("@/eodashSTAC/EodashCollection").EodashCollection[]} eodashCollections
242
+ */
243
+ async function fetchCollectionsAttributes(eodashCollections) {
244
+ if (!eodashCollections || !eodashCollections.length) {
245
+ return [];
246
+ }
230
247
 
248
+ return await Promise.all(
249
+ eodashCollections.map((ec, idx) => {
250
+ return ec.fetchCollection().then(() => {
251
+ const dateProperty = getDatetimeProperty(ec.getItems());
252
+ if (!dateProperty) {
253
+ return [];
254
+ }
231
255
  const dates = [
232
256
  ...new Set(
233
- eodashCollections[idx].getItems()?.reduce((valid, it) => {
234
- const parsed = Date.parse(/** @type {string} */ (it.datetime));
257
+ ec.getItems()?.reduce((valid, item) => {
258
+ const parsed = Date.parse(
259
+ /** @type {string} */ (item[dateProperty]),
260
+ );
235
261
  if (parsed) {
236
262
  valid.push(new Date(parsed));
237
263
  }
@@ -239,12 +265,11 @@ watch(
239
265
  }, /** @type {Date[]} */ ([])),
240
266
  ),
241
267
  ];
242
- attributes.push({
268
+ return {
243
269
  key: "id-" + idx.toString() + Math.random().toString(16).slice(2),
244
270
  dot: {
245
271
  style: {
246
- backgroundColor:
247
- collectionsPalette[idx % collectionsPalette.length],
272
+ backgroundColor: ec.color,
248
273
  },
249
274
  },
250
275
  dates,
@@ -254,13 +279,11 @@ watch(
254
279
  "font-weight": "bold",
255
280
  },
256
281
  },
257
- });
258
- }
259
- }
260
- },
261
- { immediate: true },
262
- );
263
-
282
+ };
283
+ });
284
+ }),
285
+ );
286
+ }
264
287
  /**
265
288
  * @param {boolean} reverse
266
289
  */
@@ -295,7 +318,7 @@ onMounted(() => {
295
318
  : "translate3d(0px,-80px,0)";
296
319
  });
297
320
 
298
- makePanelTransparent(rootEl);
321
+ useTransparentPanel(rootEl);
299
322
  </script>
300
323
  <style>
301
324
  .vc-popover-content {
@@ -320,7 +343,10 @@ makePanelTransparent(rootEl);
320
343
  .datePicker {
321
344
  position: absolute;
322
345
  bottom: 0;
323
- width: 100%;
346
+ left: 0;
347
+ right: 0;
348
+ margin-inline: auto;
349
+ width: fit-content;
324
350
  }
325
351
  }
326
352
  .vc-day-content {
@@ -335,4 +361,27 @@ makePanelTransparent(rootEl);
335
361
  .vc-popover-content-wrapper {
336
362
  transform: v-bind("transform") !important;
337
363
  }
364
+
365
+ .vc-date-picker-content,
366
+ .datePicker {
367
+ backdrop-filter: blur(10px) !important;
368
+ border-radius: 8px;
369
+ border: none;
370
+ box-shadow:
371
+ 0px 0px 1px rgba(24, 39, 75, 0.22),
372
+ 0px 6px 12px -6px rgba(24, 39, 75, 0.12),
373
+ 0px 8px 24px -4px rgba(24, 39, 75, 0.08);
374
+ background-color: rgba(
375
+ var(--v-theme-surface),
376
+ var(--v-surface-opacity, 0.8)
377
+ ) !important;
378
+ }
379
+
380
+ .vc-popover-caret.direction-top.align-left {
381
+ clip-path: polygon(0% 0%, 100% 0%, 0% 100%, 0% 100%);
382
+ }
383
+
384
+ .vc-bordered {
385
+ border: none;
386
+ }
338
387
  </style>
@@ -14,11 +14,11 @@
14
14
  </template>
15
15
  <script setup>
16
16
  import { useSTAcStore } from "@/store/stac";
17
+ import { isFirstLoad } from "@/utils/states";
17
18
  import "@eox/itemfilter";
18
-
19
19
  import { computed, ref } from "vue";
20
- import { useDisplay } from "vuetify/lib/framework.mjs";
21
20
 
21
+ const store = useSTAcStore();
22
22
  const emit = defineEmits(["select"]);
23
23
 
24
24
  const props = defineProps({
@@ -61,6 +61,7 @@ const props = defineProps({
61
61
  enableHighlighting: { type: Boolean, default: true },
62
62
  expandMultipleFilters: { type: Boolean, default: true },
63
63
  expandMultipleResults: { type: Boolean, default: true },
64
+ styleOverride: { type: String, default: "" },
64
65
  filterProperties: {
65
66
  /** @type {import("vue").PropType<{
66
67
  * keys:string[];
@@ -72,13 +73,15 @@ const props = defineProps({
72
73
  default: () => [
73
74
  {
74
75
  keys: ["title", "themes", "description"],
75
- title: "Search",
76
+ title: "Search by name or description",
76
77
  type: "text",
78
+ expanded: true,
77
79
  },
78
80
  {
79
81
  key: "themes",
80
- title: "Theme Filter",
82
+ title: "Filter by theme",
81
83
  type: "multiselect",
84
+ expanded: true,
82
85
  },
83
86
  ],
84
87
  },
@@ -88,8 +91,10 @@ const props = defineProps({
88
91
  */
89
92
  const selectIndicator = async (item) => {
90
93
  if (item) {
91
- // Reset compare stac to empty
92
- store.resetSelectedCompareSTAC();
94
+ if (isFirstLoad.value) {
95
+ // prevent the map from jumping to the initial position
96
+ isFirstLoad.value = false;
97
+ }
93
98
  await store.loadSelectedSTAC(item.href);
94
99
  emit("select", item);
95
100
  } else {
@@ -104,7 +109,7 @@ const selectCompareIndicator = (item) => {
104
109
  store.loadSelectedCompareSTAC(item.href);
105
110
  emit("select", item);
106
111
  } else {
107
- // TODO
112
+ store.resetSelectedCompareSTAC();
108
113
  }
109
114
  };
110
115
  /** @param {any} evt*/
@@ -116,7 +121,7 @@ const onSelect = async (evt) => {
116
121
  selectIndicator(item);
117
122
  }
118
123
  };
119
- const { smAndDown } = useDisplay();
124
+
120
125
  const config = computed(() => ({
121
126
  titleProperty: props.titleProperty,
122
127
  enableHighlighting: props.enableHighlighting,
@@ -127,10 +132,20 @@ const config = computed(() => ({
127
132
  imageProperty: props.imageProperty,
128
133
  aggregateResults: props.aggregateResults,
129
134
  style: props.cssVars,
130
- filterProperties: smAndDown.value ? "" : props.filterProperties,
135
+ filterProperties: props.filterProperties,
136
+ styleOverride: props.styleOverride,
131
137
  }));
132
138
  /** @type {import("vue").Ref<HTMLElement & Record<string,any> | null>} */
133
139
  const eoxItemFilter = ref(null);
134
-
135
- const store = useSTAcStore();
136
140
  </script>
141
+
142
+ <style scoped>
143
+ eox-itemfilter {
144
+ --form-flex-direction: row;
145
+ }
146
+ @media (max-width: 768px) {
147
+ eox-itemfilter {
148
+ --form-flex-direction: column;
149
+ }
150
+ }
151
+ </style>
@@ -1,17 +1,24 @@
1
1
  <template>
2
- <span class="d-flex flex-column fill-height overflow-auto">
2
+ <span class="d-flex flex-column">
3
3
  <eox-layercontrol
4
4
  v-if="showControls"
5
+ :key="mapElement"
5
6
  v-bind="config"
6
7
  :for="mapElement"
7
8
  @datetime:updated="debouncedHandleDateTime"
8
- class="fill-height"
9
9
  toolsAsList="true"
10
10
  style="--eox-background-color: transparent"
11
11
  ref="eoxLayercontrol"
12
12
  @layerConfig:change="onLayerConfigChange"
13
- .styleOverride="styleOverride"
14
- />
13
+ >
14
+ <slot name="layerstitle">
15
+ <div>
16
+ <p v-if="title" class="mt-2 mb-2">
17
+ <strong>{{ title }}</strong>
18
+ </p>
19
+ </div>
20
+ </slot>
21
+ </eox-layercontrol>
15
22
  </span>
16
23
  </template>
17
24
  <script setup>
@@ -44,6 +51,10 @@ const props = defineProps({
44
51
  type: Array,
45
52
  default: () => ["datetime", "info", "config", "legend", "opacity"],
46
53
  },
54
+ title: {
55
+ type: String || Boolean,
56
+ default: "Layers",
57
+ },
47
58
  cssVars: {
48
59
  type: Object,
49
60
  },
@@ -79,7 +90,6 @@ const handleDatetimeUpdate = async (evt) => {
79
90
  let updatedLayers = [];
80
91
 
81
92
  if (ec) {
82
- await ec.fetchCollection();
83
93
  updatedLayers = await ec.updateLayerJson(
84
94
  datetime,
85
95
  layer.get("id"),
@@ -128,10 +138,9 @@ const onLayerConfigChange = (evt) => {
128
138
  layerControlFormValue.value = evt.detail.jsonformValue;
129
139
  }
130
140
  };
131
-
132
- const styleOverride = `
133
- input[type="range"] {
134
- background:transparent !important;
135
- }
136
- `;
137
141
  </script>
142
+ <style scoped>
143
+ eox-layercontrol {
144
+ overflow: auto;
145
+ }
146
+ </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div ref="rootRef">
3
- <v-tooltip :text="`Switch to ${target} mode`">
3
+ <v-tooltip v-if="!mobile" :text="`Switch to ${target} mode`">
4
4
  <template v-slot:activator="{ props }">
5
5
  <v-icon
6
6
  v-bind="props"
@@ -9,15 +9,18 @@
9
9
  ></v-icon>
10
10
  </template>
11
11
  </v-tooltip>
12
+ <v-icon v-else @click="activeTemplate = target" :icon="[icon]"></v-icon>
12
13
  </div>
13
14
  </template>
14
15
 
15
16
  <script setup>
16
17
  import { activeTemplate } from "@/store/states";
17
18
  import { mdiViewDashboard } from "@mdi/js";
18
- import { makePanelTransparent } from "@/composables";
19
+ import { useTransparentPanel } from "@/composables";
19
20
  import { ref } from "vue";
21
+ import { useDisplay } from "vuetify/lib/composables/display";
20
22
 
23
+ const { mobile } = useDisplay();
21
24
  defineProps({
22
25
  target: {
23
26
  type: String,
@@ -32,5 +35,5 @@ defineProps({
32
35
 
33
36
  /** @type {import("vue").Ref<HTMLDivElement|null>} */
34
37
  const rootRef = ref(null);
35
- makePanelTransparent(rootRef);
38
+ useTransparentPanel(rootRef);
36
39
  </script>
@@ -63,11 +63,11 @@ const props = defineProps({
63
63
  center: {
64
64
  //@ts-expect-error todo
65
65
  type: Array,
66
- default: () => [15, 48],
66
+ default: () => [mapPosition.value?.[0] ?? 15, mapPosition.value?.[1] ?? 48],
67
67
  },
68
68
  zoom: {
69
69
  type: Number,
70
- default: 4,
70
+ default: mapPosition.value?.[2] ?? 4,
71
71
  },
72
72
  zoomToExtent: {
73
73
  type: Boolean,
@@ -85,10 +85,7 @@ const controls = {
85
85
  collapsible: true,
86
86
  },
87
87
  };
88
- const initialCenter = toRaw([
89
- mapPosition.value?.[0] ?? props.center?.[0],
90
- mapPosition.value?.[1] ?? props.center?.[1],
91
- ]);
88
+ const initialCenter = toRaw(props.center);
92
89
  const initialZoom = toRaw(mapPosition.value?.[2] ?? props.zoom);
93
90
  /** @type {import("vue").Ref<Record<string,any>[]>} */
94
91
  const eoxMapLayers = ref([
@@ -142,7 +139,6 @@ onMounted(() => {
142
139
  if (props.enableCompare) {
143
140
  useInitMap(
144
141
  compareMap,
145
- //@ts-expect-error todo selectedStac as collection
146
142
  selectedCompareStac,
147
143
  eodashCompareCollections,
148
144
  datetime,
@@ -156,7 +152,6 @@ onMounted(() => {
156
152
 
157
153
  useInitMap(
158
154
  eoxMap,
159
- //@ts-expect-error todo selectedStac as collection
160
155
  selectedStac,
161
156
  eodashCollections,
162
157
  datetime,
@@ -53,9 +53,10 @@ export const createLayersConfig = async (
53
53
  const indicatorLayers =
54
54
  //@ts-expect-error indicator is collection
55
55
  await EodashCollection.getIndicatorLayers(selectedIndicator);
56
- const geodbLayer = EodashCollection.getGeoDBLayer(eodashCols);
57
- if (geodbLayer) {
58
- dataLayers.layers.unshift(geodbLayer);
56
+ const observationPointsLayer =
57
+ EodashCollection.getObservationPointsLayer(eodashCols);
58
+ if (observationPointsLayer) {
59
+ dataLayers.layers.unshift(observationPointsLayer);
59
60
  }
60
61
  const baseLayers = {
61
62
  type: "Group",
@@ -1,13 +1,12 @@
1
1
  import { createLayersConfig } from "./create-layers-config";
2
2
  import { setMapProjFromCol } from "@/eodashSTAC/triggers";
3
- import { nextTick, onMounted, onUnmounted, watch } from "vue";
3
+ import { onMounted, onUnmounted, watch } from "vue";
4
4
  import log from "loglevel";
5
5
  import { useSTAcStore } from "@/store/stac";
6
6
  import { storeToRefs } from "pinia";
7
- import { useEventBus } from "@vueuse/core";
8
- import { eoxLayersKey } from "@/utils/keys";
9
- import { posIsSetFromUrl } from "@/utils/states";
10
- import { useOnLayersUpdate } from "@/composables";
7
+ import { isFirstLoad } from "@/utils/states";
8
+ import { useEmitLayersUpdate, useOnLayersUpdate } from "@/composables";
9
+ import { mapPosition } from "@/store/states";
11
10
  /**
12
11
  * Holder for previous compare map view as it is overwritten by sync
13
12
  * @type { import("ol").View | null} mapElement
@@ -35,9 +34,6 @@ export const useHandleMapMoveEnd = (mapElement, mapPosition) => {
35
34
  !Number.isNaN(z)
36
35
  ) {
37
36
  mapPosition.value = [lonlat[0], lonlat[1], z];
38
- if (posIsSetFromUrl.value) {
39
- posIsSetFromUrl.value = false;
40
- }
41
37
  }
42
38
  };
43
39
 
@@ -79,7 +75,6 @@ export const useInitMap = (
79
75
  eodashCols.values,
80
76
  datetime.value,
81
77
  );
82
- const layersEvent = useEventBus(eoxLayersKey);
83
78
 
84
79
  const stopIndicatorWatcher = watch(
85
80
  [selectedIndicator, datetime],
@@ -132,9 +127,14 @@ export const useInitMap = (
132
127
  JSON.parse(JSON.stringify(layersCollection)),
133
128
  );
134
129
  mapLayers.value = layersCollection;
135
- await nextTick(() => {
136
- layersEvent.emit("time:updated", mapLayers.value);
137
- });
130
+
131
+ useEmitLayersUpdate(
132
+ mapElement.value?.id === "compare"
133
+ ? "compareTime:updated"
134
+ : "time:updated",
135
+ mapElement.value,
136
+ layersCollection,
137
+ );
138
138
  return;
139
139
  }
140
140
 
@@ -158,7 +158,8 @@ export const useInitMap = (
158
158
  }
159
159
  if (
160
160
  endInterval !== null &&
161
- endInterval.toISOString() !== datetime.value
161
+ endInterval.toISOString() !== datetime.value &&
162
+ !isFirstLoad.value
162
163
  ) {
163
164
  datetime.value = endInterval.toISOString();
164
165
  }
@@ -169,7 +170,11 @@ export const useInitMap = (
169
170
  if (
170
171
  mapElement?.value?.id === "main" &&
171
172
  updatedStac.extent?.spatial.bbox &&
172
- !posIsSetFromUrl.value
173
+ !(
174
+ isFirstLoad.value &&
175
+ mapPosition.value?.[0] &&
176
+ mapPosition.value?.[1]
177
+ )
173
178
  ) {
174
179
  // Sanitize extent,
175
180
  const b = updatedStac.extent?.spatial.bbox[0];
@@ -189,9 +194,6 @@ export const useInitMap = (
189
194
  (mapElement.value).zoomExtent = reprojExtent;
190
195
  }
191
196
  }
192
- if (posIsSetFromUrl.value) {
193
- posIsSetFromUrl.value = false;
194
- }
195
197
 
196
198
  log.debug(
197
199
  "Assigned layers",
@@ -199,11 +201,13 @@ export const useInitMap = (
199
201
  );
200
202
  mapLayers.value = layersCollection;
201
203
  // Emit event to update layers
202
- await nextTick(() => {
203
- mapElement.value?.updateComplete.then(() => {
204
- layersEvent.emit("layers:updated", mapLayers.value);
205
- });
206
- });
204
+ await useEmitLayersUpdate(
205
+ mapElement.value?.id === "compare"
206
+ ? "compareLayers:updated"
207
+ : "layers:updated",
208
+ mapElement.value,
209
+ mapLayers.value,
210
+ );
207
211
  }
208
212
  },
209
213
  { immediate: true },
@@ -218,8 +222,14 @@ export const useInitMap = (
218
222
  * @param {import("@/eodashSTAC/EodashCollection").EodashCollection[]} eodashCols
219
223
  * @param {import("vue").Ref<Exclude<import("@/types").EodashStyleJson["tooltip"],undefined>>} tooltipProperties
220
224
  */
225
+
221
226
  export const useUpdateTooltipProperties = (eodashCols, tooltipProperties) => {
222
- useOnLayersUpdate(async () => {
227
+ useOnLayersUpdate(async (evt, _payload) => {
228
+ if (evt.includes("compare")) {
229
+ // TODO: support compare map tooltips
230
+ // Do not update tooltip properties on compare map
231
+ return;
232
+ }
223
233
  const tooltips = [];
224
234
  for (const ec of eodashCols) {
225
235
  tooltips.push(...(await ec.getToolTipProperties()));