@eodash/eodash 5.3.3 → 5.5.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 (115) hide show
  1. package/core/client/asWebComponent.js +1 -1
  2. package/core/client/composables/DefineEodash.js +3 -1
  3. package/core/client/composables/DefineWidgets.js +12 -2
  4. package/core/client/eodashSTAC/EodashCollection.js +20 -37
  5. package/core/client/eodashSTAC/createLayers.js +306 -136
  6. package/core/client/eodashSTAC/helpers.js +60 -40
  7. package/core/client/eodashSTAC/parquet.js +2 -0
  8. package/core/client/eodashSTAC/triggers.js +5 -5
  9. package/core/client/store/actions.js +17 -17
  10. package/core/client/store/states.js +26 -4
  11. package/core/client/types.ts +12 -1
  12. package/core/client/utils/index.js +18 -1
  13. package/dist/client/{DashboardLayout-Cp8Rv3Ef.js → DashboardLayout-CkSgvaFF.js} +2 -2
  14. package/dist/client/{DynamicWebComponent-CBsxC82P.js → DynamicWebComponent-Ncsg6fb9.js} +1 -1
  15. package/dist/client/EodashChart-5v7adDpG.js +144 -0
  16. package/dist/client/{EodashDatePicker-Dewym-cx.js → EodashDatePicker-RoQJe6ss.js} +4 -4
  17. package/dist/client/{EodashItemFilter-CAsZpOoQ.js → EodashItemFilter-CCoVC5BE.js} +2 -2
  18. package/dist/client/{EodashLayerControl-fn-rt8Ac.js → EodashLayerControl-weVj7aQA.js} +2 -2
  19. package/dist/client/{EodashLayoutSwitcher-B9XqQXCS.js → EodashLayoutSwitcher-CL-Z9d5_.js} +3 -3
  20. package/dist/client/EodashMapBtns-CXU8IuPO.js +433 -0
  21. package/dist/client/{EodashStacInfo-lxBKoav9.js → EodashStacInfo-BbMnjf-n.js} +11 -15
  22. package/dist/client/{EodashTimeSlider-DI97QkNT.js → EodashTimeSlider-BZXnqfax.js} +2 -2
  23. package/dist/client/{EodashTools-D5ShUT1g.js → EodashTools-DUJlkkgx.js} +4 -4
  24. package/dist/client/{ExportState-ruNyRS2E.js → ExportState-CT3FQOHW.js} +46 -21
  25. package/dist/client/{Footer-IQNyfd78.js → Footer-D_iqP-1K.js} +1 -1
  26. package/dist/client/{Header-BBdi_-Lp.js → Header-Dzhnvsy-.js} +127 -17
  27. package/dist/client/MobileLayout-6Rg_PSO8.js +118 -0
  28. package/dist/client/{PopUp-DRgOmD7-.js → PopUp-DPPv_GSA.js} +8 -59
  29. package/dist/client/{ProcessList-DxyCFQdz.js → ProcessList-BIN_Mb27.js} +9 -13
  30. package/dist/client/{VImg-hwmwzSwG.js → VImg-DhbuvNrA.js} +2 -2
  31. package/dist/client/{VMain-vk4-rkw-.js → VMain-CVabY_NY.js} +1 -1
  32. package/dist/client/{VTooltip-BYUZeia1.js → VTooltip-Cc6au3Sn.js} +3 -4
  33. package/dist/client/{WidgetsContainer-DXD_8rqh.js → WidgetsContainer-ChqTJS4h.js} +1 -1
  34. package/dist/client/asWebComponent-DaIxULaA.js +9207 -0
  35. package/dist/client/{async-D1MvO_Z_.js → async-D6Lvv-fT.js} +15 -5
  36. package/dist/client/eo-dash.js +1 -1
  37. package/dist/client/{forwardRefs-DM-E2MfG.js → forwardRefs--IccUBdR.js} +196 -37
  38. package/dist/client/{handling-CbgeKrqT.js → handling-DSA67d6E.js} +160 -37
  39. package/dist/client/{helpers-CtUlAW0N.js → helpers-BBSdbOmv.js} +239 -126
  40. package/dist/client/{index-DBo0F4Fv.js → index-6LlXNkke.js} +5 -3
  41. package/dist/client/{index-BJvLt3Xf.js → index-BS-8Y5FE.js} +34 -77
  42. package/dist/client/{index-BkW06-Lg.js → index-CQihL_c6.js} +55 -15
  43. package/dist/client/{index-BxDh5v-H.js → index-qsZhYR_6.js} +15 -16
  44. package/dist/client/templates.js +52 -2
  45. package/dist/client/{transition-BdzATvPB.js → transition-DFr4cXu8.js} +1 -1
  46. package/dist/node/cli.js +1 -1
  47. package/dist/types/core/client/App.vue.d.ts +16 -6
  48. package/dist/types/core/client/asWebComponent.d.ts +2 -2
  49. package/dist/types/core/client/components/DashboardLayout.vue.d.ts +2 -1
  50. package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +36 -16
  51. package/dist/types/core/client/components/EodashOverlay.vue.d.ts +2 -1
  52. package/dist/types/core/client/components/ErrorAlert.vue.d.ts +9 -1
  53. package/dist/types/core/client/components/Footer.vue.d.ts +2 -1
  54. package/dist/types/core/client/components/Header.vue.d.ts +2 -1
  55. package/dist/types/core/client/components/IframeWrapper.vue.d.ts +12 -6
  56. package/dist/types/core/client/components/Loading.vue.d.ts +2 -1
  57. package/dist/types/core/client/components/MobileLayout.vue.d.ts +2 -1
  58. package/dist/types/core/client/composables/DefineEodash.d.ts +1 -1
  59. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +27 -11
  60. package/dist/types/core/client/eodashSTAC/createLayers.d.ts +30 -23
  61. package/dist/types/core/client/eodashSTAC/helpers.d.ts +11 -4
  62. package/dist/types/core/client/store/actions.d.ts +1 -2
  63. package/dist/types/core/client/store/states.d.ts +22 -4
  64. package/dist/types/core/client/types.d.ts +7 -2
  65. package/dist/types/core/client/utils/index.d.ts +1 -0
  66. package/dist/types/core/client/views/Dashboard.vue.d.ts +20 -8
  67. package/dist/types/templates/compare.d.ts +20 -0
  68. package/dist/types/templates/expert.d.ts +30 -1
  69. package/dist/types/widgets/EodashChart.vue.d.ts +28 -0
  70. package/dist/types/widgets/EodashDatePicker.vue.d.ts +38 -9
  71. package/dist/types/widgets/EodashItemCatalog/index.vue.d.ts +88 -13
  72. package/dist/types/widgets/EodashItemCatalog/methods/map.d.ts +1 -1
  73. package/dist/types/widgets/EodashItemFilter.vue.d.ts +169 -26
  74. package/dist/types/widgets/EodashLayerControl.vue.d.ts +38 -10
  75. package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +22 -7
  76. package/dist/types/widgets/EodashMap/EodashMapBtns.vue.d.ts +94 -19
  77. package/dist/types/widgets/EodashMap/index.vue.d.ts +647 -92
  78. package/dist/types/widgets/EodashMap/methods/btns.d.ts +14 -0
  79. package/dist/types/widgets/EodashProcess/ProcessList.vue.d.ts +24 -7
  80. package/dist/types/widgets/EodashProcess/index.vue.d.ts +26 -7
  81. package/dist/types/widgets/EodashProcess/methods/composables.d.ts +1 -2
  82. package/dist/types/widgets/EodashProcess/methods/handling.d.ts +18 -11
  83. package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +2 -2
  84. package/dist/types/widgets/EodashProcess/methods/utils.d.ts +1 -0
  85. package/dist/types/widgets/EodashStacInfo.vue.d.ts +67 -18
  86. package/dist/types/widgets/EodashTimeSlider.vue.d.ts +14 -6
  87. package/dist/types/widgets/EodashTools.vue.d.ts +437 -47
  88. package/dist/types/widgets/ExportState.vue.d.ts +26 -8
  89. package/dist/types/widgets/PopUp.vue.d.ts +61 -11
  90. package/dist/types/widgets/WidgetsContainer.vue.d.ts +22 -6
  91. package/package.json +33 -34
  92. package/templates/baseConfig.js +2 -1
  93. package/templates/compare.js +28 -1
  94. package/templates/expert.js +23 -1
  95. package/widgets/EodashChart.vue +139 -0
  96. package/widgets/EodashItemCatalog/index.vue +2 -2
  97. package/widgets/EodashItemCatalog/methods/map.js +9 -10
  98. package/widgets/EodashMap/EodashMapBtns.vue +73 -93
  99. package/widgets/EodashMap/index.vue +14 -2
  100. package/widgets/EodashMap/methods/btns.js +155 -0
  101. package/widgets/EodashMap/methods/create-layers-config.js +26 -3
  102. package/widgets/EodashMap/methods/index.js +2 -1
  103. package/widgets/EodashProcess/ProcessList.vue +2 -3
  104. package/widgets/EodashProcess/index.vue +19 -70
  105. package/widgets/EodashProcess/methods/async.js +1 -1
  106. package/widgets/EodashProcess/methods/composables.js +13 -6
  107. package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +20 -7
  108. package/widgets/EodashProcess/methods/handling.js +100 -22
  109. package/widgets/EodashProcess/methods/outputs.js +44 -4
  110. package/widgets/EodashProcess/methods/utils.js +11 -1
  111. package/widgets/EodashStacInfo.vue +10 -23
  112. package/widgets/ExportState.vue +9 -15
  113. package/dist/client/EodashMapBtns-nFY6MIAX.js +0 -301
  114. package/dist/client/MobileLayout-BfBeF-JF.js +0 -118
  115. package/dist/client/asWebComponent-DdguWGDI.js +0 -8967
@@ -1,24 +1,24 @@
1
1
  <template>
2
2
  <div ref="rootRef" class="map-buttons d-flex flex-column align-end">
3
3
  <button
4
- v-if="enableZoom"
4
+ v-if="enableZoom && !isGlobe"
5
5
  class="primary small circle small-elevate"
6
6
  @click="onMapZoomIn"
7
7
  >
8
8
  <i class="small"
9
- ><svg viewBox="0 0 24 24"><path :d="mdiPlus" /></svg
10
- ></i>
9
+ ><svg viewBox="0 0 24 24"><path :d="mdiPlus" /></svg>
10
+ </i>
11
11
  <div class="tooltip left">Zoom in</div>
12
12
  </button>
13
13
 
14
14
  <button
15
- v-if="enableZoom"
15
+ v-if="enableZoom && !isGlobe"
16
16
  class="primary small circle small-elevate"
17
17
  @click="onMapZoomOut"
18
18
  >
19
19
  <i class="small"
20
- ><svg viewBox="0 0 24 24"><path :d="mdiMinus" /></svg
21
- ></i>
20
+ ><svg viewBox="0 0 24 24"><path :d="mdiMinus" /></svg>
21
+ </i>
22
22
  <div class="tooltip left">Zoom out</div>
23
23
  </button>
24
24
 
@@ -28,8 +28,8 @@
28
28
  @click="showMapState = !showMapState"
29
29
  >
30
30
  <i class="small"
31
- ><svg viewBox="0 0 24 24"><path :d="mdiMapPlus" /></svg
32
- ></i>
31
+ ><svg viewBox="0 0 24 24"><path :d="mdiMapPlus" /></svg>
32
+ </i>
33
33
  <div class="tooltip left">Extract storytelling configuration</div>
34
34
  </button>
35
35
  <ExportState v-if="exportMap" v-model="showMapState" />
@@ -40,18 +40,18 @@
40
40
  @click="changeMapProjection(availableMapProjection)"
41
41
  >
42
42
  <i class="small"
43
- ><svg viewBox="0 0 24 24"><path :d="mdiEarthBox" /></svg
44
- ></i>
43
+ ><svg viewBox="0 0 24 24"><path :d="mdiEarthBox" /></svg>
44
+ </i>
45
45
  <div class="tooltip left">Change map projection</div>
46
46
  </button>
47
47
  <button
48
- v-if="compareIndicators"
48
+ v-if="compareIndicators && !isGlobe"
49
49
  class="primary small circle small-elevate"
50
- @click="onCompareClick"
50
+ @click="onCompareClick(compareIndicators)"
51
51
  >
52
52
  <i class="small"
53
- ><svg viewBox="0 0 24 24"><path :d="compareIcon" /></svg
54
- ></i>
53
+ ><svg viewBox="0 0 24 24"><path :d="compareIcon" /></svg>
54
+ </i>
55
55
  <div class="tooltip left">Compare mode</div>
56
56
  </button>
57
57
  <button
@@ -61,14 +61,30 @@
61
61
  >
62
62
  <i class="small"
63
63
  ><svg viewBox="0 0 24 24">
64
- <path :d="mdiStarFourPointsCircleOutline" /></svg
65
- ></i>
64
+ <path :d="mdiStarFourPointsCircleOutline" />
65
+ </svg>
66
+ </i>
66
67
  <div class="tooltip left">Back to POIs</div>
67
68
  </button>
69
+ <button
70
+ v-if="enableGlobe && !isInCompareMode"
71
+ class="primary small circle small-elevate"
72
+ @click="switchGlobe"
73
+ >
74
+ <i class="small"
75
+ ><svg viewBox="0 0 24 24">
76
+ <path :d="mdiEarth" />
77
+ </svg>
78
+ </i>
79
+ <div class="tooltip left">
80
+ {{ isGlobe ? "switch to 2D" : "switch to 3D" }}
81
+ </div>
82
+ </button>
68
83
  <eox-geosearch
69
- v-if="mapEl && enableSearch"
84
+ v-if="mapEl && !isGlobe && enableSearch"
70
85
  :for="mapEl"
71
86
  :endpoint="opencageUrl"
87
+ :params="searchParams"
72
88
  class="geosearch-detached"
73
89
  label="Search"
74
90
  small
@@ -95,11 +111,12 @@
95
111
  </template>
96
112
  <script setup>
97
113
  import { useTransparentPanel } from "@/composables";
98
- import { changeMapProjection, setActiveTemplate } from "@/store/actions";
114
+ import { changeMapProjection } from "@/store/actions";
99
115
  import {
100
116
  activeTemplate,
101
117
  availableMapProjection,
102
118
  comparePoi,
119
+ isGlobe,
103
120
  mapEl,
104
121
  poi,
105
122
  } from "@/store/states";
@@ -111,17 +128,22 @@ import {
111
128
  mdiMinus,
112
129
  mdiPlus,
113
130
  mdiStarFourPointsCircleOutline,
131
+ mdiEarth,
114
132
  } from "@mdi/js";
115
133
  import ExportState from "^/ExportState.vue";
116
- import { computed, ref, triggerRef } from "vue";
134
+ import { computed, ref } from "vue";
117
135
  import PopUp from "^/PopUp.vue";
118
136
  import EodashItemFilter from "^/EodashItemFilter.vue";
119
137
  import { useDisplay } from "vuetify";
120
- import { useSTAcStore } from "@/store/stac";
121
- import { storeToRefs } from "pinia";
122
138
  import { loadPOiIndicator } from "^/EodashProcess/methods/handling";
123
- import { easeOut } from "ol/easing.js";
124
-
139
+ import {
140
+ onCompareClick,
141
+ onSelectCompareIndicator,
142
+ switchGlobe,
143
+ onMapZoomOut,
144
+ onMapZoomIn,
145
+ showCompareIndicators,
146
+ } from "./methods/btns";
125
147
  import "@eox/geosearch";
126
148
 
127
149
  const {
@@ -131,6 +153,8 @@ const {
131
153
  backToPOIs,
132
154
  enableSearch,
133
155
  enableZoom,
156
+ searchParams,
157
+ enableGlobe,
134
158
  } = defineProps({
135
159
  exportMap: {
136
160
  type: Boolean,
@@ -157,26 +181,34 @@ const {
157
181
  type: Boolean,
158
182
  default: true,
159
183
  },
184
+ searchParams: {
185
+ type: [Boolean, Object],
186
+ default: true,
187
+ },
160
188
  enableZoom: {
161
189
  type: Boolean,
162
190
  default: true,
163
191
  },
192
+ enableGlobe: {
193
+ type: Boolean,
194
+ default: true,
195
+ },
164
196
  });
165
- const { selectedStac, selectedCompareStac } = storeToRefs(useSTAcStore());
166
- const { resetSelectedCompareSTAC } = useSTAcStore();
197
+
167
198
  const { smAndDown } = useDisplay();
168
199
  const popupWidth = computed(() => (smAndDown.value ? "80%" : "70%"));
169
200
  const popupHeight = computed(() => (smAndDown.value ? "90%" : "70%"));
170
201
 
171
202
  const showMapState = ref(false);
172
- const showCompareIndicators = ref(false);
203
+ const isInCompareMode = computed(
204
+ () =>
205
+ activeTemplate.value ===
206
+ ((typeof compareIndicators === "object" &&
207
+ compareIndicators?.compareTemplate) ||
208
+ "compare"),
209
+ );
173
210
  const compareIcon = computed(() =>
174
- activeTemplate.value ===
175
- ((typeof compareIndicators === "object" &&
176
- compareIndicators?.compareTemplate) ||
177
- "compare")
178
- ? mdiCompareRemove
179
- : mdiCompare,
211
+ isInCompareMode.value ? mdiCompareRemove : mdiCompare,
180
212
  );
181
213
  const itemFilterConfig = {
182
214
  enableHighlighting: false,
@@ -191,83 +223,31 @@ const itemFilterConfig = {
191
223
  compareIndicators.itemFilterConfig),
192
224
  };
193
225
 
194
- const onCompareClick = () => {
195
- showCompareIndicators.value =
196
- activeTemplate.value !==
197
- ((typeof compareIndicators === "object" &&
198
- compareIndicators.compareTemplate) ||
199
- "compare");
200
-
201
- const fallbackTemplate =
202
- (typeof compareIndicators === "object" &&
203
- compareIndicators.fallbackTemplate) ||
204
- "expert";
205
- selectedCompareStac.value = null;
206
- resetSelectedCompareSTAC();
207
- setActiveTemplate(fallbackTemplate);
208
- triggerRef(selectedStac);
209
- };
210
-
211
226
  /** @type {import("vue").Ref<HTMLDivElement|null>} */
212
227
  const rootRef = ref(null);
213
228
 
214
- const onSelectCompareIndicator = () => {
215
- const compareTemplate =
216
- (typeof compareIndicators === "object" &&
217
- compareIndicators.compareTemplate) ||
218
- "compare";
219
- setActiveTemplate(compareTemplate);
220
- showCompareIndicators.value = !showCompareIndicators.value;
221
- };
222
-
223
229
  useTransparentPanel(rootRef);
224
230
 
225
- const onMapZoomOut = () => {
226
- const map = mapEl.value?.map;
227
- const currentZoom = map?.getView().getZoom();
228
- if (currentZoom !== undefined && currentZoom !== null) {
229
- const view = map?.getView();
230
-
231
- if (view !== undefined && view.getZoom()) {
232
- view.animate({
233
- zoom: currentZoom - 1,
234
- duration: 250,
235
- easing: easeOut,
236
- });
237
- }
238
- }
239
- };
240
-
241
- const onMapZoomIn = () => {
242
- const map = mapEl.value?.map;
243
- const currentZoom = map?.getView().getZoom();
244
- if (currentZoom !== undefined && currentZoom !== null) {
245
- const view = map?.getView();
246
-
247
- if (view !== undefined && view.getZoom()) {
248
- view.animate({
249
- zoom: currentZoom + 1,
250
- duration: 250,
251
- easing: easeOut,
252
- });
253
- }
254
- }
255
- };
256
231
  const opencageApiKey = process.env.EODASH_OPENCAGE || "NO_KEY_FOUND";
257
232
  const opencageUrl = `https://api.opencagedata.com/geocode/v1/json?key=${opencageApiKey}`;
258
-
259
- /*const menu = document
260
- .querySelector("eox-geosearch")
261
- .renderRoot.querySelector("menu");*/
262
233
  </script>
263
234
 
264
235
  <style scoped>
265
236
  @import url("@eox/ui/style.css");
237
+ /* Make sure panel does pass click event through */
238
+ .map-buttons {
239
+ pointer-events: none !important;
240
+ }
266
241
 
267
242
  .map-buttons button {
243
+ pointer-events: auto !important;
268
244
  margin-bottom: 5px;
269
245
  background-color: var(--primary);
270
246
  }
247
+ /* Make sure buttons have pointer event */
248
+ .geosearch-detached {
249
+ pointer-events: auto !important;
250
+ }
271
251
 
272
252
  /* Container constraints removal */
273
253
  eox-geosearch {
@@ -46,7 +46,7 @@
46
46
  <!-- prettier-ignore -->
47
47
  <EodashMapBtns
48
48
  :style="{
49
- gridColumn: (indicator || compareIndicator || poi) ? responsiveX : '12',
49
+ gridColumn: (indicator || compareIndicator || poi) && !isGlobe ? responsiveX : '12',
50
50
  gridRow: responsiveY,
51
51
  }"
52
52
  :exportMap="(indicator || compareIndicator || poi) ? btnsProps.exportMap : false"
@@ -60,6 +60,8 @@
60
60
  "
61
61
  :enableZoom="(indicator || compareIndicator || poi) ? btnsProps.enableZoom : false
62
62
  "
63
+ :enableGlobe="(indicator || compareIndicator || poi) ? btnsProps.enableGlobe : false"
64
+ :searchParams="btnsProps.searchParams"
63
65
  />
64
66
  </div>
65
67
  </span>
@@ -76,6 +78,7 @@ import {
76
78
  indicator,
77
79
  compareIndicator,
78
80
  poi,
81
+ isGlobe,
79
82
  } from "@/store/states";
80
83
  import { storeToRefs } from "pinia";
81
84
  import { useSTAcStore } from "@/store/stac";
@@ -136,7 +139,9 @@ const props = defineProps({
136
139
  * enableChangeProjection?: boolean;
137
140
  * enableBackToPOIs?: boolean;
138
141
  * enableSearch?: boolean;
142
+ * searchParams?: object;
139
143
  * enableZoom?: boolean;
144
+ * enableGlobe?: boolean;
140
145
  * enableCompareIndicators?: boolean | {
141
146
  * compareTemplate?:string;
142
147
  * fallbackTemplate?:string;
@@ -151,6 +156,8 @@ const props = defineProps({
151
156
  enableBackToPOIs: true,
152
157
  enableSearch: true,
153
158
  enableZoom: true,
159
+ enableGlobe: true,
160
+ searchParams: {},
154
161
  }),
155
162
  },
156
163
  });
@@ -192,8 +199,13 @@ const btnsProps = computed(() => ({
192
199
  backToPOIs: props.btns.enableBackToPOIs ?? true,
193
200
  enableSearch: props.btns.enableSearch ?? true,
194
201
  enableZoom: props.btns.enableZoom ?? true,
202
+ enableGlobe: props.btns.enableGlobe ?? true,
203
+ searchParams: props.btns.searchParams,
195
204
  }));
196
205
 
206
+ if (btnsProps.value.enableGlobe) {
207
+ await import("@eox/map/src/plugins/globe");
208
+ }
197
209
  // Prepare containers for scale line and cursor coordinates
198
210
  const scaleLineRef = useTemplateRef("scale-line");
199
211
  const cursorCoordsRef = useTemplateRef("cursor-coords");
@@ -382,7 +394,7 @@ onMounted(() => {
382
394
  left: 24px;
383
395
  bottom: 54px; /* Tighter spacing: watermark at 6px + ~48px */
384
396
  color: rgba(0, 0, 0, 0.9);
385
- font-size: 11px;
397
+ font-size: 10px;
386
398
  font-family: var(--eox-body-font-family);
387
399
  background: #fffe;
388
400
  border-radius: 4px;
@@ -0,0 +1,155 @@
1
+ import { getLayers, setActiveTemplate } from "@/store/actions";
2
+ import { useSTAcStore } from "@/store/stac";
3
+ import { activeTemplate, isGlobe, mapEl } from "@/store/states";
4
+ import { easeOut } from "ol/easing.js";
5
+ import { storeToRefs } from "pinia";
6
+ import { ref } from "vue";
7
+ import { triggerRef } from "vue";
8
+
9
+ export const switchGlobe = () => {
10
+ if (!mapEl.value) {
11
+ return;
12
+ }
13
+ if (!isGlobe.value) {
14
+ mapEl.value.layers = addCorsAnonym([...getLayers()]);
15
+ }
16
+ mapEl.value.projection = isGlobe.value ? "EPSG:3857" : "globe";
17
+ if (isGlobe.value) {
18
+ showAllPanels();
19
+ } else hideAllPanels();
20
+ isGlobe.value = !isGlobe.value;
21
+ };
22
+
23
+ function hideAllPanels() {
24
+ const allPanels = document.querySelectorAll(
25
+ "eox-layout-item:not([class='bg-panel'])",
26
+ );
27
+ allPanels.forEach((panel) => {
28
+ if (!panel || !(panel instanceof HTMLElement)) {
29
+ return;
30
+ }
31
+ panel.style.display = "none";
32
+ });
33
+ }
34
+ function showAllPanels() {
35
+ const allPanels = document.querySelectorAll(
36
+ "eox-layout-item:not([class='bg-panel'])",
37
+ );
38
+ allPanels.forEach((panel) => {
39
+ if (!panel || !(panel instanceof HTMLElement)) {
40
+ return;
41
+ }
42
+ panel.style.display = "";
43
+ });
44
+ }
45
+ /**
46
+ *
47
+ * @param {import("@eox/map").EoxLayer[]} layers
48
+ * @return {import("@eox/map").EoxLayer[]}
49
+ */
50
+ function addCorsAnonym(layers) {
51
+ //@ts-expect-error todo
52
+ return layers.map((layer) => {
53
+ if (layer.type === "Group") {
54
+ layer.layers = addCorsAnonym([...(layer.layers ?? [])]);
55
+ return layer;
56
+ }
57
+ // check if not mapbox style as a fix for ts error
58
+ if (layer.type === "MapboxStyle") {
59
+ return layer;
60
+ }
61
+
62
+ return {
63
+ ...layer,
64
+ ...(layer.source && {
65
+ source: {
66
+ ...layer.source,
67
+ crossOrigin: "anonymous",
68
+ },
69
+ ...(layer.sources && {
70
+ sources: layer.sources.map((source) => ({
71
+ ...source,
72
+ crossOrigin: "anonymous",
73
+ })),
74
+ }),
75
+ }),
76
+ };
77
+ });
78
+ }
79
+
80
+ export const onMapZoomOut = () => {
81
+ const map = mapEl.value?.map;
82
+ const currentZoom = map?.getView().getZoom();
83
+ if (currentZoom !== undefined && currentZoom !== null) {
84
+ const view = map?.getView();
85
+
86
+ if (view !== undefined && view.getZoom()) {
87
+ view.animate({
88
+ zoom: currentZoom - 1,
89
+ duration: 250,
90
+ easing: easeOut,
91
+ });
92
+ }
93
+ }
94
+ };
95
+
96
+ export const onMapZoomIn = () => {
97
+ const map = mapEl.value?.map;
98
+ const currentZoom = map?.getView().getZoom();
99
+ if (currentZoom !== undefined && currentZoom !== null) {
100
+ const view = map?.getView();
101
+
102
+ if (view !== undefined && view.getZoom()) {
103
+ view.animate({
104
+ zoom: currentZoom + 1,
105
+ duration: 250,
106
+ easing: easeOut,
107
+ });
108
+ }
109
+ }
110
+ };
111
+
112
+ export const showCompareIndicators = ref(false);
113
+ /**
114
+ *
115
+ * @param {boolean | {
116
+ * compareTemplate?:string;
117
+ * fallbackTemplate?:string;
118
+ * itemFilterConfig?:Partial<InstanceType<import("./EodashItemFilter.vue").default>["$props"]>
119
+ * }} compareIndicators
120
+ */
121
+ export const onSelectCompareIndicator = (compareIndicators) => {
122
+ const compareTemplate =
123
+ (typeof compareIndicators === "object" &&
124
+ compareIndicators.compareTemplate) ||
125
+ "compare";
126
+ setActiveTemplate(compareTemplate);
127
+ showCompareIndicators.value = !showCompareIndicators.value;
128
+ };
129
+
130
+ /**
131
+ *
132
+ * @param {boolean | {
133
+ * compareTemplate?:string;
134
+ * fallbackTemplate?:string;
135
+ * itemFilterConfig?:Partial<InstanceType<import("./EodashItemFilter.vue").default>["$props"]>
136
+ * }} compareIndicators
137
+ */
138
+ export const onCompareClick = (compareIndicators) => {
139
+ const { selectedStac, selectedCompareStac } = storeToRefs(useSTAcStore());
140
+ const { resetSelectedCompareSTAC } = useSTAcStore();
141
+ showCompareIndicators.value =
142
+ activeTemplate.value !==
143
+ ((typeof compareIndicators === "object" &&
144
+ compareIndicators.compareTemplate) ||
145
+ "compare");
146
+
147
+ const fallbackTemplate =
148
+ (typeof compareIndicators === "object" &&
149
+ compareIndicators.fallbackTemplate) ||
150
+ "expert";
151
+ selectedCompareStac.value = null;
152
+ resetSelectedCompareSTAC();
153
+ setActiveTemplate(fallbackTemplate);
154
+ triggerRef(selectedStac);
155
+ };
@@ -52,6 +52,29 @@ export const createLayersConfig = async (
52
52
  dataLayers.layers.push(...layers);
53
53
  }
54
54
 
55
+ /* check for roles in indicator links to assign visibility property for the data layers */
56
+ if (selectedIndicator?.links) {
57
+ const visibilityLinks = selectedIndicator.links.filter(
58
+ (link) =>
59
+ Array.isArray(link.roles) &&
60
+ (link.roles.includes("disable") || link.roles.includes("hidden")),
61
+ );
62
+ if (visibilityLinks.length > 0) {
63
+ visibilityLinks.forEach((vl) => {
64
+ const targetLayerId = vl.id;
65
+ const targetLayer = dataLayers.layers.find(
66
+ (dl) => dl.properties.id.split(";:;")[0] === targetLayerId,
67
+ );
68
+ if (targetLayer) {
69
+ if (Array.isArray(vl.roles) && vl.roles.includes("disable")) {
70
+ targetLayer.properties.visible = false;
71
+ } else if (Array.isArray(vl.roles) && vl.roles.includes("hidden")) {
72
+ targetLayer.properties.layerControlHide = true;
73
+ }
74
+ }
75
+ });
76
+ }
77
+ }
55
78
  layersCollection.push(dataLayers);
56
79
  const indicatorLayers =
57
80
  //@ts-expect-error indicator is collection
@@ -59,7 +82,7 @@ export const createLayersConfig = async (
59
82
  const observationPointsLayer =
60
83
  EodashCollection.getObservationPointsLayer(eodashCols);
61
84
  if (observationPointsLayer) {
62
- dataLayers.layers.unshift(observationPointsLayer);
85
+ dataLayers.layers.push(observationPointsLayer);
63
86
  }
64
87
  const baseLayers = {
65
88
  type: "Group",
@@ -130,7 +153,7 @@ export const createLayersConfig = async (
130
153
  }
131
154
 
132
155
  if (baseLayers.layers.length) {
133
- layersCollection.push(baseLayers);
156
+ layersCollection.unshift(baseLayers);
134
157
  }
135
158
 
136
159
  const overlayLayers = {
@@ -148,7 +171,7 @@ export const createLayersConfig = async (
148
171
 
149
172
  if (indicatorOverlays.length) {
150
173
  overlayLayers.layers.push(...indicatorOverlays);
151
- layersCollection.unshift(overlayLayers);
174
+ layersCollection.push(overlayLayers);
152
175
  }
153
176
 
154
177
  return layersCollection;
@@ -8,6 +8,7 @@ import { isFirstLoad } from "@/utils/states";
8
8
  import { useEmitLayersUpdate, useOnLayersUpdate } from "@/composables";
9
9
  import { mapPosition } from "@/store/states";
10
10
  import { sanitizeBbox } from "@/eodashSTAC/helpers";
11
+ import { transformExtent } from "@eox/map";
11
12
  /**
12
13
  * Holder for previous compare map view as it is overwritten by sync
13
14
  * @type { import("ol").View | null} mapElement
@@ -201,7 +202,7 @@ export const useInitMap = (
201
202
  const b = updatedStac.extent?.spatial.bbox[0];
202
203
  const sanitizedExtent = sanitizeBbox([...b]);
203
204
 
204
- const reprojExtent = mapElement.value?.transformExtent(
205
+ const reprojExtent = transformExtent(
205
206
  sanitizedExtent,
206
207
  "EPSG:4326",
207
208
  mapElement.value?.map?.getView().getProjection(),
@@ -25,8 +25,8 @@
25
25
  >{{
26
26
  new Date(item.job_start_datetime).toISOString().slice(0, 16)
27
27
  }}
28
- <v-icon>mdi-open-in-new</v-icon></a
29
- >
28
+ <v-icon :icon="[mdiOpenInNew]" />
29
+ </a>
30
30
  </td>
31
31
  <td>{{ item.status }}</td>
32
32
  <td style="padding: 0px">
@@ -73,7 +73,6 @@
73
73
  </div>
74
74
  </template>
75
75
  <script setup>
76
- /* eslint-disable @typescript-eslint/no-unused-vars */
77
76
  import {
78
77
  mdiUploadBox,
79
78
  mdiDownloadBox,