@eodash/eodash 5.1.0 → 5.3.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 (133) hide show
  1. package/core/client/components/DashboardLayout.vue +1 -2
  2. package/core/client/components/EodashOverlay.vue +4 -5
  3. package/core/client/components/MobileLayout.vue +42 -21
  4. package/core/client/composables/index.js +54 -60
  5. package/core/client/eodashSTAC/EodashCollection.js +199 -108
  6. package/core/client/eodashSTAC/auth.js +86 -0
  7. package/core/client/eodashSTAC/createLayers.js +234 -4
  8. package/core/client/eodashSTAC/helpers.js +281 -59
  9. package/core/client/eodashSTAC/parquet.js +0 -13
  10. package/core/client/eodashSTAC/triggers.js +1 -1
  11. package/core/client/store/actions.js +14 -0
  12. package/core/client/store/stac.js +46 -8
  13. package/core/client/store/states.js +6 -0
  14. package/core/client/types.ts +206 -3
  15. package/core/client/utils/bands-editor/arithmetic.js +144 -0
  16. package/core/client/utils/bands-editor/colors.js +36 -0
  17. package/core/client/utils/bands-editor/dom.js +196 -0
  18. package/core/client/utils/bands-editor/exampleSchema.json +1320 -0
  19. package/core/client/utils/bands-editor/index.js +68 -0
  20. package/core/client/utils/bands-editor/rgb.js +102 -0
  21. package/core/client/utils/index.js +5 -2
  22. package/core/client/views/Dashboard.vue +1 -1
  23. package/core/client/vite-env.d.ts +122 -0
  24. package/dist/client/{DashboardLayout-ByVs1DrY.js → DashboardLayout-Cq15p4TH.js} +5 -6
  25. package/dist/client/{DynamicWebComponent-C3W7HSQm.js → DynamicWebComponent-Cv-fPRG1.js} +1 -1
  26. package/dist/client/{EodashDatePicker-BIAf1sMT.js → EodashDatePicker-CPlJwEIO.js} +20 -22
  27. package/dist/client/{EodashItemFilter-DPznh8UB.js → EodashItemFilter-Ydebgbjj.js} +46 -31
  28. package/dist/client/EodashLayerControl-COhrkNEs.js +1517 -0
  29. package/dist/client/{EodashLayoutSwitcher-C5qTEffW.js → EodashLayoutSwitcher-pnKhTRZV.js} +4 -4
  30. package/dist/client/EodashMapBtns-Cj0Fx119.js +301 -0
  31. package/dist/client/{EodashStacInfo-CSvvF2jI.js → EodashStacInfo-Dadkg_Nj.js} +1 -1
  32. package/dist/client/EodashTimeSlider-CpoHX0S7.js +53 -0
  33. package/dist/client/{EodashTools-Cv1SXQ5y.js → EodashTools-UGBG7KC9.js} +10 -7
  34. package/dist/client/{ExportState-D-iuwaad.js → ExportState-GtJkAqeZ.js} +145 -121
  35. package/dist/client/{Footer-CyF0zRAk.js → Footer-D3ZPG5c4.js} +1 -1
  36. package/dist/client/{Header-CgD8jDKU.js → Header-z6AK-wpN.js} +2 -3
  37. package/dist/client/MobileLayout-BXNsNftb.js +118 -0
  38. package/dist/client/{PopUp-BsYLvWch.js → PopUp-BbQdjENV.js} +79 -44
  39. package/dist/client/{ProcessList-C2xsLU2_.js → ProcessList-C6VsdsYI.js} +18 -12
  40. package/dist/client/{VImg-OHe8YTs2.js → VImg-CxaMSB99.js} +203 -5
  41. package/dist/client/{VMain-PryTLU4a.js → VMain-Ds7yw0wj.js} +1 -1
  42. package/dist/client/{VTooltip-DZ0fjpB3.js → VTooltip-Cze6CEVh.js} +2 -3
  43. package/dist/client/{WidgetsContainer-B9LBadcC.js → WidgetsContainer-D66bj-JJ.js} +1 -1
  44. package/dist/client/asWebComponent-CWbNRdf9.js +8895 -0
  45. package/dist/client/{async-DkSu_u2K.js → async-BA7oWCMX.js} +69 -5
  46. package/dist/client/easing-CH0-9wR8.js +35 -0
  47. package/dist/client/eo-dash.js +1 -1
  48. package/dist/client/{VOverlay-yUn7p-Uf.js → forwardRefs-BUfxOIo-.js} +308 -28
  49. package/dist/client/{handling-CgmFXkW6.js → handling-DlNTtKB-.js} +27 -6
  50. package/dist/client/{helpers-Dy0Q13tP.js → helpers-CtE0W7iu.js} +595 -278
  51. package/dist/client/{index-skjhlH8u.js → index-CeEZIjO6.js} +26 -13
  52. package/dist/client/{index-Ch_HchK3.js → index-CsKbRDeN.js} +238 -77
  53. package/dist/client/{index-Dqj4tbx2.js → index-D4_NRKrf.js} +2 -2
  54. package/dist/client/index-DeECc3lV.js +571 -0
  55. package/dist/client/material-symbols-outlined.woff2 +0 -0
  56. package/dist/client/material-symbols-rounded.woff2 +0 -0
  57. package/dist/client/material-symbols-sharp.woff2 +0 -0
  58. package/dist/client/material-symbols-subset.woff2 +0 -0
  59. package/dist/client/templates.js +106 -49
  60. package/dist/client/{transition-C98Yn4Vo.js → transition-Byvp3L6Y.js} +1 -1
  61. package/dist/node/cli.js +6 -6
  62. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +24 -10
  63. package/dist/types/core/client/eodashSTAC/auth.d.ts +7 -0
  64. package/dist/types/core/client/eodashSTAC/createLayers.d.ts +15 -3
  65. package/dist/types/core/client/eodashSTAC/helpers.d.ts +51 -15
  66. package/dist/types/core/client/plugins/vuetify.d.ts +14 -14
  67. package/dist/types/core/client/store/actions.d.ts +2 -0
  68. package/dist/types/core/client/store/stac.d.ts +16 -7
  69. package/dist/types/core/client/store/states.d.ts +4 -0
  70. package/dist/types/core/client/types.d.ts +171 -3
  71. package/dist/types/core/client/utils/bands-editor/arithmetic.d.ts +8 -0
  72. package/dist/types/core/client/utils/bands-editor/colors.d.ts +15 -0
  73. package/dist/types/core/client/utils/bands-editor/dom.d.ts +42 -0
  74. package/dist/types/core/client/utils/bands-editor/index.d.ts +20 -0
  75. package/dist/types/core/client/utils/bands-editor/rgb.d.ts +15 -0
  76. package/dist/types/core/client/utils/index.d.ts +1 -1
  77. package/dist/types/templates/baseConfig.d.ts +87 -1
  78. package/dist/types/templates/compare.d.ts +0 -25
  79. package/dist/types/templates/expert.d.ts +17 -21
  80. package/dist/types/templates/explore.d.ts +67 -0
  81. package/dist/types/templates/index.d.ts +1 -1
  82. package/dist/types/templates/{light.d.ts → lite.d.ts} +9 -0
  83. package/dist/types/widgets/EodashItemCatalog/index.vue.d.ts +21 -0
  84. package/dist/types/widgets/EodashItemCatalog/methods/filters.d.ts +49 -0
  85. package/dist/types/widgets/EodashItemCatalog/methods/handlers.d.ts +4 -0
  86. package/dist/types/widgets/EodashItemCatalog/methods/map.d.ts +12 -0
  87. package/dist/types/widgets/EodashItemCatalog/types.d.ts +14 -0
  88. package/dist/types/widgets/{EodashMapBtns.vue.d.ts → EodashMap/EodashMapBtns.vue.d.ts} +6 -0
  89. package/dist/types/widgets/EodashMap/index.vue.d.ts +114 -0
  90. package/dist/types/widgets/EodashMap/methods/create-layers-config.d.ts +1 -1
  91. package/dist/types/widgets/EodashMap/methods/index.d.ts +1 -1
  92. package/dist/types/widgets/EodashProcess/methods/async.d.ts +1 -0
  93. package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.d.ts +1 -1
  94. package/dist/types/widgets/EodashTimeSlider.vue.d.ts +7 -0
  95. package/dist/types/widgets/EodashTools.vue.d.ts +10 -10
  96. package/dist/types/widgets/ExportState.vue.d.ts +2 -0
  97. package/package.json +31 -28
  98. package/templates/baseConfig.js +10 -5
  99. package/templates/compare.js +2 -22
  100. package/templates/expert.js +19 -18
  101. package/templates/explore.js +62 -0
  102. package/templates/index.js +1 -1
  103. package/templates/{light.js → lite.js} +11 -2
  104. package/widgets/EodashDatePicker.vue +15 -18
  105. package/widgets/EodashItemCatalog/index.vue +161 -0
  106. package/widgets/EodashItemCatalog/methods/filters.js +216 -0
  107. package/widgets/EodashItemCatalog/methods/handlers.js +50 -0
  108. package/widgets/EodashItemCatalog/methods/map.js +144 -0
  109. package/widgets/EodashItemCatalog/types.ts +15 -0
  110. package/widgets/EodashItemFilter.vue +35 -28
  111. package/widgets/EodashLayerControl.vue +10 -6
  112. package/widgets/EodashLayoutSwitcher.vue +1 -1
  113. package/widgets/EodashMap/EodashMapBtns.vue +278 -0
  114. package/widgets/EodashMap/index.vue +263 -38
  115. package/widgets/EodashMap/methods/create-layers-config.js +9 -6
  116. package/widgets/EodashMap/methods/index.js +27 -13
  117. package/widgets/EodashProcess/ProcessList.vue +13 -1
  118. package/widgets/EodashProcess/index.vue +17 -1
  119. package/widgets/EodashProcess/methods/async.js +22 -1
  120. package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +25 -3
  121. package/widgets/EodashProcess/methods/handling.js +2 -0
  122. package/widgets/EodashProcess/methods/outputs.js +1 -0
  123. package/widgets/EodashProcess/methods/utils.js +45 -1
  124. package/widgets/EodashTimeSlider.vue +40 -0
  125. package/widgets/EodashTools.vue +7 -3
  126. package/widgets/ExportState.vue +53 -22
  127. package/dist/client/EodashLayerControl-Bhxjw4V2.js +0 -154
  128. package/dist/client/EodashMapBtns-WoGq8MuV.js +0 -173
  129. package/dist/client/MobileLayout-EKQ_kpSh.js +0 -1226
  130. package/dist/client/asWebComponent-By_7_JjS.js +0 -19193
  131. package/dist/client/forwardRefs-BXxrv98s.js +0 -272
  132. package/dist/client/index-BuhOHXKv.js +0 -199
  133. package/widgets/EodashMapBtns.vue +0 -155
@@ -3,6 +3,7 @@ import {
3
3
  extractLayerConfig,
4
4
  mergeGeojsons,
5
5
  replaceLayer,
6
+ extractLayerLegend,
6
7
  } from "@/eodashSTAC/helpers";
7
8
  import axios from "@/plugins/axios";
8
9
  import { getCompareLayers, getLayers } from "@/store/actions";
@@ -290,7 +291,10 @@ export async function creatAsyncProcessLayerDefinitions(
290
291
 
291
292
  for (const resultItem of processResults) {
292
293
  const flatStyleJSON = extractStyleFromResult(resultItem, flatStyles);
293
- let style, layerConfig;
294
+ /** @type {import("@/types").EodashStyleJson | undefined} */
295
+ let style;
296
+ /** @type {Record<string, unknown> | undefined} */
297
+ let layerConfig;
294
298
  if (flatStyleJSON) {
295
299
  const extracted = extractLayerConfig(
296
300
  selectedStac?.id ?? "",
@@ -300,6 +304,9 @@ export async function creatAsyncProcessLayerDefinitions(
300
304
  style = extracted.style;
301
305
  }
302
306
 
307
+ // Check if collection has eox:colorlegend definition, if yes overwrite legend description
308
+ let extraProperties = extractLayerLegend(selectedStac);
309
+
303
310
  switch (resultItem.type) {
304
311
  case "image/tiff": {
305
312
  layers.push({
@@ -313,6 +320,7 @@ export async function creatAsyncProcessLayerDefinitions(
313
320
  (resultItem.id ?? ""),
314
321
  layerControlToolsExpand: true,
315
322
  ...(layerConfig && { layerConfig }),
323
+ ...extraProperties,
316
324
  },
317
325
  source: {
318
326
  type: "GeoTIFF",
@@ -350,12 +358,48 @@ export async function creatAsyncProcessLayerDefinitions(
350
358
  style,
351
359
  },
352
360
  }),
361
+ ...extraProperties,
353
362
  },
354
363
  ...(!style?.variables && { style }),
355
364
  interactions: [],
356
365
  });
357
366
  break;
358
367
  }
368
+ case "application/vnd.flatgeobuf": {
369
+ // TODO after more flatgeobuf urls are possible in EOxMap https://github.com/EOX-A/EOxElements/issues/1789
370
+ // we should change this handler to only create one layer instead of many
371
+ resultItem.urls.forEach((url, i) => {
372
+ layers.push({
373
+ type: "Vector",
374
+ source: {
375
+ type: "FlatGeoBuf",
376
+ url,
377
+ },
378
+ properties: {
379
+ id:
380
+ endpointLink.id +
381
+ "_process_" +
382
+ resultItem.id +
383
+ postfixId +
384
+ `_${i}`,
385
+ title:
386
+ "Results " +
387
+ (selectedStac?.id ?? "") +
388
+ " " +
389
+ (resultItem.id ?? ""),
390
+ layerControlToolsExpand: true,
391
+ ...(layerConfig && {
392
+ layerConfig: {
393
+ ...layerConfig,
394
+ style,
395
+ },
396
+ }),
397
+ ...extraProperties,
398
+ },
399
+ });
400
+ });
401
+ break;
402
+ }
359
403
  default:
360
404
  console.warn(
361
405
  `[eodash] Unsupported result type "${resultItem.type}" for ${resultItem.id} layer creation.`,
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <eox-timeslider
3
+ v-if="hasMultipleItems"
4
+ :key="mapEl"
5
+ @update="update"
6
+ .externalMapRendering="true"
7
+ .filters="filters"
8
+ titleKey="title"
9
+ layerIdKey="id"
10
+ for="eox-map#main"
11
+ />
12
+ </template>
13
+ <script setup>
14
+ import { datetime, mapEl } from "@/store/states";
15
+ import { eodashCollections } from "@/utils/states";
16
+ import "@eox/timeslider";
17
+ import { computed } from "vue";
18
+
19
+ defineProps({
20
+ filters: {
21
+ type: Array,
22
+ default: () => [],
23
+ },
24
+ });
25
+
26
+ const hasMultipleItems = computed(() => {
27
+ return eodashCollections.some((ec) => {
28
+ const itemLinks = ec.collectionStac?.links.filter((l) => l.rel === "item");
29
+ const itemsLink = ec.collectionStac?.links.some((l) => l.rel === "items");
30
+ return (itemLinks && itemLinks.length > 1) || itemsLink;
31
+ });
32
+ });
33
+ /**
34
+ *
35
+ * @param {CustomEvent} e
36
+ */
37
+ const update = (e) => {
38
+ datetime.value = e.detail.date.toISOString();
39
+ };
40
+ </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div ref="rootEl" class="d-flex flex-column fill-height bg-primary">
3
3
  <div
4
- class="d-flex flex-row align-center fill-height justify-space-between pa-2 align-center"
4
+ class="d-flex flex-row align-center fill-height justify-space-between pa-1 align-center"
5
5
  >
6
6
  <v-btn
7
7
  v-if="props.showIndicatorsBtn"
@@ -61,7 +61,7 @@ const props = defineProps({
61
61
  },
62
62
  layoutTarget: {
63
63
  type: String,
64
- default: "light",
64
+ default: "lite",
65
65
  },
66
66
  // mdi/js icon
67
67
  layoutIcon: {
@@ -81,4 +81,8 @@ const props = defineProps({
81
81
  const rootEl = ref(null);
82
82
  useTransparentPanel(rootEl);
83
83
  </script>
84
- <style lang="scss" scoped></style>
84
+ <style lang="scss" scoped>
85
+ .v-btn--size-default {
86
+ --v-btn-height: 30px;
87
+ }
88
+ </style>
@@ -6,12 +6,19 @@
6
6
  </v-card-title>
7
7
 
8
8
  <v-card-text class="py-5 overflow-auto" style="height: 400px">
9
- <p class="text-body-2">
10
- Copy and paste this code into the map <b>layers field</b> of the
11
- storytelling editor:
12
- </p>
13
- <div class="pa-3 code-block">
14
- {{ removeUnneededProperties(getLayers()) }}
9
+ <div class="d-flex flex-wrap gap-2 mb-4">
10
+ <v-btn
11
+ v-for="btn in copyBtns"
12
+ v-show="!btn.showIf || btn.showIf()"
13
+ class="text-body-2"
14
+ @click="btn.copyFn"
15
+ :key="btn.id"
16
+ small
17
+ variant="text"
18
+ :prepend-icon="[mdiContentCopy]"
19
+ >
20
+ copy as {{ btn.copyAs }}
21
+ </v-btn>
15
22
  </div>
16
23
 
17
24
  <div style="position: absolute; bottom: 15px">
@@ -22,21 +29,22 @@
22
29
  </div>
23
30
  </v-expand-transition>
24
31
  </div>
25
- <v-row class="d-flex pt-3 justify-end">
26
- <v-col cols="6" class="flex-column align-center text-end">
27
- <v-btn
28
- v-for="btn in copyBtns"
29
- class="text-body-2"
30
- @click="btn.copyFn"
31
- :key="btn.id"
32
- small
33
- variant="text"
34
- :prepend-icon="[mdiContentCopy]"
35
- >
36
- copy as {{ btn.copyAs }}
37
- </v-btn>
38
- </v-col>
39
- </v-row>
32
+
33
+ <p class="text-body-2 mb-2">
34
+ <strong>Map Layers Configuration</strong>
35
+ </p>
36
+ <div class="pa-3 code-block mb-4">
37
+ {{ removeUnneededProperties(getLayers()) }}
38
+ </div>
39
+
40
+ <div v-if="props.getChartSpec?.()" class="mb-4">
41
+ <p class="text-body-2 mb-2">
42
+ <strong>Chart Spec (for export)</strong>
43
+ </p>
44
+ <div class="pa-3 code-block">
45
+ {{ getChartExportCode() }}
46
+ </div>
47
+ </div>
40
48
  </v-card-text>
41
49
 
42
50
  <v-divider></v-divider>
@@ -53,7 +61,10 @@ import { mdiClipboardCheckOutline, mdiContentCopy } from "@mdi/js";
53
61
  import PopUp from "./PopUp.vue";
54
62
  import { copyToClipBoard } from "@/utils";
55
63
  import { ref } from "vue";
56
- import { getLayers as getLayerAction } from "@/store/actions";
64
+ import {
65
+ getLayers as getLayerAction,
66
+ getChartSpec as getChartSpecAction,
67
+ } from "@/store/actions";
57
68
  import { mapPosition, availableMapProjection } from "@/store/states";
58
69
  import { removeUnneededProperties } from "@/eodashSTAC/helpers";
59
70
 
@@ -64,6 +75,10 @@ const props = defineProps({
64
75
  type: Function,
65
76
  default: getLayerAction,
66
77
  },
78
+ getChartSpec: {
79
+ type: Function,
80
+ default: getChartSpecAction,
81
+ },
67
82
  });
68
83
 
69
84
  const copySuccess = ref(false);
@@ -85,6 +100,13 @@ const copyBtns = [
85
100
  copyFn: async () => await copyToClipBoard(getMapStepCode(), copySuccess),
86
101
  copyAs: "map tour section",
87
102
  },
103
+ {
104
+ id: Symbol(),
105
+ copyFn: async () =>
106
+ await copyToClipBoard(getChartExportCode(), copySuccess),
107
+ copyAs: "chart",
108
+ showIf: () => !!props.getChartSpec?.(),
109
+ },
88
110
  ];
89
111
 
90
112
  const getMapStepCode = () => {
@@ -104,6 +126,15 @@ const getMapEntryCode = () => {
104
126
  const endTag = `zoom="${z}" center=[${[x, y]}] projection="${availableMapProjection.value}" }-->`;
105
127
  return `${preTag}'${JSON.stringify(removeUnneededProperties(props.getLayers()))}' ${endTag}`;
106
128
  };
129
+
130
+ const getChartExportCode = () => {
131
+ const chartSpec = props.getChartSpec?.();
132
+ if (!chartSpec) return "";
133
+ const preTag =
134
+ "## Chart Example <!" + '--{as="eox-chart" style="height: 300px;" spec=';
135
+ const endTag = " }-->";
136
+ return `${preTag}'${JSON.stringify(chartSpec)}'${endTag}`;
137
+ };
107
138
  </script>
108
139
  <style scoped>
109
140
  .code-block {
@@ -1,154 +0,0 @@
1
- import { computed, ref, createElementBlock, openBlock, createCommentVNode, mergeProps, unref, renderSlot, createElementVNode, toDisplayString } from 'vue';
2
- import '@eox/layercontrol';
3
- import '@eox/jsonform';
4
- import '@eox/timecontrol';
5
- import 'color-legend-element';
6
- import { H as mapCompareEl, d as mapEl, I as getColFromLayer } from './helpers-Dy0Q13tP.js';
7
- import { _ as _export_sfc, Y as useSTAcStore, a1 as layerControlFormValueCompare, a2 as layerControlFormValue, a0 as eodashCompareCollections, $ as eodashCollections } from './asWebComponent-By_7_JjS.js';
8
- import { storeToRefs } from 'pinia';
9
-
10
- const _style_0 = "eox-layercontrol[data-v-88d02d9c]{overflow:auto}";
11
-
12
- const _hoisted_1 = { class: "d-flex flex-column" };
13
- const _hoisted_2 = ["for"];
14
- const _hoisted_3 = {
15
- key: 0,
16
- class: "mt-2 mb-2"
17
- };
18
-
19
-
20
- const _sfc_main = {
21
- __name: 'EodashLayerControl',
22
- props: {
23
- map: {
24
- /** @type {import("vue").PropType<"first" | "second">} */
25
- //@ts-expect-error todo
26
- type: String,
27
- default: "first",
28
- },
29
- tools: {
30
- type: Array,
31
- default: () => ["datetime", "info", "config", "legend", "opacity"],
32
- },
33
- title: {
34
- type: String || Boolean,
35
- default: "Layers",
36
- },
37
- cssVars: {
38
- type: Object,
39
- },
40
- },
41
- setup(__props) {
42
-
43
- const props = __props;
44
-
45
- const config = {
46
- tools: props.tools,
47
- style: props.cssVars,
48
- };
49
-
50
- const { selectedCompareStac, selectedStac } = storeToRefs(useSTAcStore());
51
- const showControls = computed(() => {
52
- if (props.map === "second") {
53
- return mapCompareEl.value !== null && selectedCompareStac.value !== null;
54
- }
55
- return mapEl.value !== null && selectedStac.value !== null;
56
- });
57
-
58
- const eodashCols =
59
- props.map === "second" ? eodashCompareCollections : eodashCollections;
60
- const mapElement = props.map === "second" ? mapCompareEl : mapEl;
61
-
62
- /** @type { import("vue").Ref<HTMLElement & Record<string,any> | null>} */
63
- const eoxLayercontrol = ref(null);
64
-
65
- /** @param {CustomEvent<{layer:import('ol/layer').Layer; datetime:string;}>} evt */
66
- const handleDatetimeUpdate = async (evt) => {
67
- const { layer, datetime } = evt.detail;
68
-
69
- const ec = await getColFromLayer(eodashCols, layer);
70
-
71
- /** @type {Record<string,any>[] | undefined} */
72
- let updatedLayers = [];
73
-
74
- if (ec) {
75
- updatedLayers = await ec.updateLayerJson(
76
- datetime,
77
- layer.get("id"),
78
- props.map,
79
- );
80
- }
81
- /** @type {Record<String,any>[] | undefined} */
82
- const dataLayers = updatedLayers?.find(
83
- (l) => l?.properties?.id === "AnalysisGroup",
84
- )?.layers;
85
-
86
- if (dataLayers?.length) {
87
- // Add expand to all analysis layers
88
- dataLayers?.forEach((dl) => {
89
- dl.properties.layerControlExpand = true;
90
- dl.properties.layerControlToolsExpand = true;
91
- });
92
- // assign layers to the map
93
- /** @type {HTMLElement & Record<string,any>} */
94
- (mapElement.value).layers = updatedLayers;
95
- }
96
- };
97
-
98
- // ----- debounce logic
99
- /** @type {NodeJS.Timeout | undefined} */
100
- let timeout;
101
-
102
- /**
103
- * @param {CustomEvent<{layer:import('ol/layer').Layer; datetime:string;}>} evt
104
- **/
105
- const debouncedHandleDateTime = (evt) => {
106
- clearTimeout(timeout);
107
- timeout = setTimeout(() => {
108
- handleDatetimeUpdate(evt);
109
- }, 500);
110
- };
111
- // ------
112
- /**
113
- *
114
- * @param {Event & {detail:{layer:import("ol/layer").Layer;jsonformValue:Record<string,any>}}} evt
115
- */
116
- const onLayerConfigChange = (evt) => {
117
- if (props.map === "second") {
118
- layerControlFormValueCompare.value = evt.detail.jsonformValue;
119
- } else {
120
- layerControlFormValue.value = evt.detail.jsonformValue;
121
- }
122
- };
123
-
124
- return (_ctx, _cache) => {
125
- return (openBlock(), createElementBlock("span", _hoisted_1, [
126
- (showControls.value)
127
- ? (openBlock(), createElementBlock("eox-layercontrol", mergeProps({ key: unref(mapElement) }, config, {
128
- for: unref(mapElement),
129
- "onDatetime:updated": debouncedHandleDateTime,
130
- toolsAsList: "true",
131
- style: {"--eox-background-color":"transparent"},
132
- ref_key: "eoxLayercontrol",
133
- ref: eoxLayercontrol,
134
- "on:layerConfig:change": onLayerConfigChange
135
- }), [
136
- renderSlot(_ctx.$slots, "layerstitle", {}, () => [
137
- createElementVNode("div", null, [
138
- (__props.title)
139
- ? (openBlock(), createElementBlock("p", _hoisted_3, [
140
- createElementVNode("strong", null, toDisplayString(__props.title), 1 /* TEXT */)
141
- ]))
142
- : createCommentVNode("v-if", true)
143
- ])
144
- ], true)
145
- ], 16 /* FULL_PROPS */, _hoisted_2))
146
- : createCommentVNode("v-if", true)
147
- ]))
148
- }
149
- }
150
-
151
- };
152
- const EodashLayerControl = /*#__PURE__*/_export_sfc(_sfc_main, [['styles',[_style_0]],['__scopeId',"data-v-88d02d9c"]]);
153
-
154
- export { EodashLayerControl as default };
@@ -1,173 +0,0 @@
1
- import { computed, ref, createElementBlock, openBlock, withDirectives, createCommentVNode, createBlock, createVNode, unref, withCtx, triggerRef } from 'vue';
2
- import { _ as _export_sfc, Y as useSTAcStore, r as useDisplay, Z as useTransparentPanel, V as VBtn } from './asWebComponent-By_7_JjS.js';
3
- import { z as activeTemplate, K as availableMapProjection, L as changeMapProjection, y as poi, D as comparePoi, M as setActiveTemplate } from './helpers-Dy0Q13tP.js';
4
- import { mdiCompareRemove, mdiCompare, mdiMapPlus, mdiEarthBox, mdiStarFourPointsCircleOutline } from '@mdi/js';
5
- import ExportState from './ExportState-D-iuwaad.js';
6
- import _sfc_main$1 from './PopUp-BsYLvWch.js';
7
- import EodashItemFilter from './EodashItemFilter-DPznh8UB.js';
8
- import { storeToRefs } from 'pinia';
9
- import { l as loadPOiIndicator } from './handling-CgmFXkW6.js';
10
- import { T as Tooltip } from './index-Dqj4tbx2.js';
11
-
12
- const _style_0 = ".map-btn[data-v-771740c6]{width:36px;height:36px;border-radius:25%;margin:4px}";
13
-
14
- const _sfc_main = {
15
- __name: 'EodashMapBtns',
16
- props: {
17
- exportMap: {
18
- type: Boolean,
19
- default: true,
20
- },
21
- changeProjection: {
22
- type: Boolean,
23
- default: true,
24
- },
25
- compareIndicators: {
26
- /** @type {import("vue").PropType<boolean | {compareTemplate?:string;fallbackTemplate?:string}> }*/
27
- type: [Boolean, Object],
28
- default: true,
29
- },
30
- backToPOIs: {
31
- type: Boolean,
32
- default: true,
33
- },
34
- },
35
- setup(__props) {
36
-
37
-
38
- const { selectedStac, selectedCompareStac } = storeToRefs(useSTAcStore());
39
- const { resetSelectedCompareSTAC } = useSTAcStore();
40
- const { smAndDown } = useDisplay();
41
- const popupWidth = computed(() => (smAndDown.value ? "80%" : "70%"));
42
- const popupHeight = computed(() => (smAndDown.value ? "90%" : "70%"));
43
-
44
- const showMapState = ref(false);
45
- const showCompareIndicators = ref(false);
46
- const compareIcon = computed(() =>
47
- activeTemplate.value ===
48
- ((typeof __props.compareIndicators === "object" &&
49
- __props.compareIndicators?.compareTemplate) ||
50
- "compare")
51
- ? mdiCompareRemove
52
- : mdiCompare,
53
- );
54
-
55
- const onCompareClick = () => {
56
- showCompareIndicators.value = !showCompareIndicators.value;
57
-
58
- const fallbackTemplate =
59
- (typeof __props.compareIndicators === "object" &&
60
- __props.compareIndicators.fallbackTemplate) ||
61
- "expert";
62
- selectedCompareStac.value = null;
63
- resetSelectedCompareSTAC();
64
- setActiveTemplate(fallbackTemplate);
65
- triggerRef(selectedStac);
66
- };
67
-
68
- /** @type {import("vue").Ref<HTMLDivElement|null>} */
69
- const rootRef = ref(null);
70
-
71
- const onSelectCompareIndicator = () => {
72
- const compareTemplate =
73
- (typeof __props.compareIndicators === "object" &&
74
- __props.compareIndicators.compareTemplate) ||
75
- "compare";
76
- setActiveTemplate(compareTemplate);
77
- showCompareIndicators.value = !showCompareIndicators.value;
78
- };
79
-
80
- useTransparentPanel(rootRef);
81
-
82
- return (_ctx, _cache) => {
83
-
84
-
85
-
86
- return (openBlock(), createElementBlock("div", {
87
- ref_key: "rootRef",
88
- ref: rootRef,
89
- class: "d-flex flex-column align-end"
90
- }, [
91
- (__props.exportMap)
92
- ? withDirectives((openBlock(), createBlock(VBtn, {
93
- key: 0,
94
- class: "map-btn",
95
- icon: [unref(mdiMapPlus)],
96
- size: "small",
97
- onClick: _cache[0] || (_cache[0] = $event => (showMapState.value = !showMapState.value))
98
- }, null, 8 /* PROPS */, ["icon"])), [
99
- [Tooltip, 'Extract Storytelling configuration', "bottom"]
100
- ])
101
- : createCommentVNode("v-if", true),
102
- (__props.exportMap)
103
- ? (openBlock(), createBlock(ExportState, {
104
- key: 1,
105
- modelValue: showMapState.value,
106
- "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => ((showMapState).value = $event))
107
- }, null, 8 /* PROPS */, ["modelValue"]))
108
- : createCommentVNode("v-if", true),
109
- (__props.changeProjection && !!unref(availableMapProjection))
110
- ? withDirectives((openBlock(), createBlock(VBtn, {
111
- key: 2,
112
- class: "map-btn",
113
- icon: [unref(mdiEarthBox)],
114
- size: "small",
115
- onClick: _cache[2] || (_cache[2] = $event => (unref(changeMapProjection)(unref(availableMapProjection))))
116
- }, null, 8 /* PROPS */, ["icon"])), [
117
- [Tooltip, 'Change map projection', "bottom"]
118
- ])
119
- : createCommentVNode("v-if", true),
120
- (__props.compareIndicators)
121
- ? withDirectives((openBlock(), createBlock(VBtn, {
122
- key: 3,
123
- class: "map-btn",
124
- icon: [compareIcon.value],
125
- size: "small",
126
- onClick: onCompareClick
127
- }, null, 8 /* PROPS */, ["icon"])), [
128
- [Tooltip, 'Compare mode', "bottom"]
129
- ])
130
- : createCommentVNode("v-if", true),
131
- (__props.backToPOIs && (unref(poi) || unref(comparePoi)))
132
- ? withDirectives((openBlock(), createBlock(VBtn, {
133
- key: 4,
134
- class: "map-btn",
135
- icon: [unref(mdiStarFourPointsCircleOutline)],
136
- size: "small",
137
- onClick: _cache[3] || (_cache[3] = $event => (unref(loadPOiIndicator)()))
138
- }, null, 8 /* PROPS */, ["icon"])), [
139
- [Tooltip, 'back to POIs', "bottom"]
140
- ])
141
- : createCommentVNode("v-if", true),
142
- createVNode(_sfc_main$1, {
143
- modelValue: showCompareIndicators.value,
144
- "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => ((showCompareIndicators).value = $event)),
145
- maxWidth: popupWidth.value,
146
- width: popupWidth.value,
147
- "max-height": popupHeight.value,
148
- height: popupHeight.value
149
- }, {
150
- default: withCtx(() => [
151
- createVNode(EodashItemFilter, {
152
- enableCompare: true,
153
- enableHighlighting: false,
154
- resultType: "cards",
155
- style: {"--select-filter-max-items":"8"},
156
- "filters-title": "Select an indicator to compare",
157
- subTitleProperty: "subtitle",
158
- imageProperty: "thumbnail",
159
- aggregateResults: "collection_group",
160
- "results-title": "",
161
- onSelect: onSelectCompareIndicator
162
- })
163
- ]),
164
- _: 1 /* STABLE */
165
- }, 8 /* PROPS */, ["modelValue", "maxWidth", "width", "max-height", "height"])
166
- ], 512 /* NEED_PATCH */))
167
- }
168
- }
169
-
170
- };
171
- const EodashMapBtns = /*#__PURE__*/_export_sfc(_sfc_main, [['styles',[_style_0]],['__scopeId',"data-v-771740c6"]]);
172
-
173
- export { EodashMapBtns as default };