@eodash/eodash 5.0.0-rc.2.5 → 5.0.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 (77) hide show
  1. package/core/client/composables/DefineWidgets.js +8 -1
  2. package/core/client/eodash.js +9 -9
  3. package/core/client/eodashSTAC/createLayers.js +4 -18
  4. package/core/client/eodashSTAC/helpers.js +23 -0
  5. package/core/client/store/stac.js +3 -1
  6. package/core/client/types.ts +125 -19
  7. package/core/client/utils/states.js +9 -0
  8. package/dist/client/{DashboardLayout-BX3Sm_Vx.js → DashboardLayout-CkWvOMOW.js} +2 -2
  9. package/dist/client/{DynamicWebComponent-BqoHM1np.js → DynamicWebComponent-DYBbpvUK.js} +1 -1
  10. package/dist/client/{EodashDatePicker-BoWV2vc8.js → EodashDatePicker-CALmW3SI.js} +3 -83
  11. package/dist/client/{EodashItemFilter-127fZLyK.js → EodashItemFilter-DlQiE713.js} +1 -1
  12. package/dist/client/{EodashLayerControl-B-pZaizw.js → EodashLayerControl-DEzEbft7.js} +8 -2
  13. package/dist/client/{EodashLayoutSwitcher-DwexHfOD.js → EodashLayoutSwitcher-CDeCV8F-.js} +2 -2
  14. package/dist/client/{EodashMapBtns-Jfn3bpWD.js → EodashMapBtns-CktQCfa-.js} +36 -12
  15. package/dist/client/{EodashStacInfo-STq_bW7S.js → EodashStacInfo-DPPxDkF6.js} +7 -1
  16. package/dist/client/{EodashTools-uxSuJhVJ.js → EodashTools-CUaL9s4H.js} +5 -4
  17. package/dist/client/{ExportState-Ckcb6u01.js → ExportState-DjyIZVhl.js} +27 -12
  18. package/dist/client/{Footer-C8JP-coH.js → Footer-DyL0JoWt.js} +1 -1
  19. package/dist/client/{Header-Dxx7q9FW.js → Header-B5Dgty9l.js} +3 -3
  20. package/dist/client/{MobileLayout-BE19Peep.js → MobileLayout-CRsg_5Q4.js} +5 -5
  21. package/dist/client/{PopUp-D3IyjsN4.js → PopUp-BfB8s_ki.js} +3 -3
  22. package/dist/client/ProcessList-DTefwQZx.js +484 -0
  23. package/dist/client/{VImg-BmCNSu3X.js → VImg-FD1WVphJ.js} +2 -2
  24. package/dist/client/{VMain-eZDKIfmJ.js → VMain-DJKG4SvM.js} +1 -1
  25. package/dist/client/{VOverlay-BS-E4Z6g.js → VOverlay-BzOdRu9h.js} +15 -6
  26. package/dist/client/{VTooltip-BMsliOuh.js → VTooltip-CfeefrXI.js} +3 -3
  27. package/dist/client/{WidgetsContainer-Cl6M5R5c.js → WidgetsContainer-C2TaTdb6.js} +1 -1
  28. package/dist/client/{asWebComponent-Df8nUiLs.js → asWebComponent-CLhcT715.js} +100 -96
  29. package/dist/client/eo-dash.css +2 -2
  30. package/dist/client/eo-dash.js +1 -1
  31. package/dist/client/{forwardRefs-lhDuXD-N.js → forwardRefs-Bon_Kku1.js} +9 -9
  32. package/dist/client/index-4CT7Tz83.js +85 -0
  33. package/dist/client/{index-Bt5GEGxl.js → index-Bm9cbtx5.js} +1 -1
  34. package/dist/client/{EodashMap-BSR7_wRA.js → index-CIHH_3dW.js} +101 -80
  35. package/dist/client/{EodashProcess-CpbZPYBp.js → index-DiGDvTQU.js} +346 -468
  36. package/dist/client/{transition-DHEuQX4I.js → transition-C5I57hn6.js} +1 -1
  37. package/dist/types/core/client/components/MobileLayout.vue.d.ts +9 -9
  38. package/dist/types/core/client/eodashSTAC/helpers.d.ts +3 -2
  39. package/dist/types/core/client/types.d.ts +83 -17
  40. package/dist/types/core/client/utils/states.d.ts +7 -0
  41. package/dist/types/widgets/EodashDatePicker.vue.d.ts +4 -4
  42. package/dist/types/widgets/EodashItemFilter.vue.d.ts +18 -18
  43. package/dist/types/widgets/EodashLayerControl.vue.d.ts +2 -2
  44. package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +2 -2
  45. package/dist/types/widgets/EodashMap/methods/create-layers-config.d.ts +9 -0
  46. package/dist/types/widgets/EodashMap/methods/index.d.ts +5 -0
  47. package/dist/types/widgets/EodashMapBtns.vue.d.ts +8 -2
  48. package/dist/types/widgets/EodashProcess/ProcessList.vue.d.ts +2 -0
  49. package/dist/types/widgets/EodashProcess/methods/async.d.ts +45 -0
  50. package/dist/types/widgets/EodashProcess/methods/composables.d.ts +19 -0
  51. package/dist/types/widgets/EodashProcess/methods/handling.d.ts +78 -0
  52. package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +54 -0
  53. package/dist/types/widgets/EodashProcess/methods/utils.d.ts +42 -0
  54. package/dist/types/widgets/EodashStacInfo.vue.d.ts +12 -12
  55. package/dist/types/widgets/EodashTools.vue.d.ts +44 -6
  56. package/dist/types/widgets/PopUp.vue.d.ts +4 -4
  57. package/package.json +27 -27
  58. package/widgets/EodashLayerControl.vue +8 -1
  59. package/widgets/{EodashMap.vue → EodashMap/index.vue} +51 -31
  60. package/widgets/EodashMap/methods/create-layers-config.js +151 -0
  61. package/{core/client/composables/EodashMap.js → widgets/EodashMap/methods/index.js} +4 -153
  62. package/widgets/EodashMapBtns.vue +33 -7
  63. package/widgets/EodashProcess/ProcessList.vue +82 -0
  64. package/widgets/EodashProcess/index.vue +186 -0
  65. package/widgets/EodashProcess/methods/async.js +209 -0
  66. package/widgets/EodashProcess/methods/composables.js +129 -0
  67. package/widgets/EodashProcess/methods/handling.js +254 -0
  68. package/widgets/EodashProcess/methods/outputs.js +216 -0
  69. package/widgets/EodashProcess/methods/utils.js +138 -0
  70. package/widgets/EodashStacInfo.vue +6 -0
  71. package/widgets/EodashTools.vue +1 -0
  72. package/core/client/composables/EodashProcess.js +0 -654
  73. package/dist/types/core/client/composables/EodashMap.d.ts +0 -6
  74. package/dist/types/core/client/composables/EodashProcess.d.ts +0 -162
  75. package/widgets/EodashProcess.vue +0 -206
  76. /package/dist/types/widgets/{EodashMap.vue.d.ts → EodashMap/index.vue.d.ts} +0 -0
  77. /package/dist/types/widgets/{EodashProcess.vue.d.ts → EodashProcess/index.vue.d.ts} +0 -0
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @param {import("stac-ts").StacLink[] | undefined} links
3
+ * @param {Record<string,any>|undefined} jsonformValue
4
+ * @param {number[]} origBbox
5
+ */
6
+ export function processImage(links: import("stac-ts").StacLink[] | undefined, jsonformValue: Record<string, any> | undefined, origBbox: number[]): {
7
+ type: string;
8
+ properties: {
9
+ id: unknown;
10
+ title: string;
11
+ };
12
+ source: {
13
+ type: string;
14
+ imageExtent: number[];
15
+ url: string;
16
+ };
17
+ }[] | undefined;
18
+ /**
19
+ * @param {import("stac-ts").StacLink[] | undefined} links
20
+ * @param {Record<string,any> | undefined} jsonformValue
21
+ * @param {string} layerId
22
+ */
23
+ export function processVector(links: import("stac-ts").StacLink[] | undefined, jsonformValue: Record<string, any> | undefined, layerId: string): Promise<Record<string, any>[] | undefined>;
24
+ /**
25
+ * @param {import("stac-ts").StacLink[] | undefined} links
26
+ * @param {Record<string,any> | undefined} jsonformValue
27
+ * @param {string} specUrl
28
+ * @returns {Promise<[import("@eox/chart").EOxChart["spec"] | null,Record<string,any>|null]>}
29
+ **/
30
+ export function getChartValues(links: import("stac-ts").StacLink[] | undefined, jsonformValue: Record<string, any> | undefined, specUrl: string): Promise<[import("@eox/chart").EOxChart["spec"] | null, Record<string, any> | null]>;
31
+ /**
32
+ * @param {import("stac-ts").StacLink[] | undefined} links
33
+ * @param {Record<string,any> | undefined} jsonformValue
34
+ * @param {import("vue").Ref<boolean>} isPolling
35
+ * @param {string} layerId
36
+ * @param {string} projection
37
+ */
38
+ export function processGeoTiff(links: import("stac-ts").StacLink[] | undefined, jsonformValue: Record<string, any> | undefined, layerId: string, isPolling: import("vue").Ref<boolean>, projection: string): Promise<{
39
+ style?: Record<string, any> | undefined;
40
+ type: string;
41
+ source: {
42
+ type: string;
43
+ normalize: boolean;
44
+ sources: {
45
+ url: string;
46
+ }[];
47
+ };
48
+ properties: {
49
+ layerControlToolsExpand: boolean;
50
+ layerConfig?: Record<string, any> | undefined;
51
+ id: string;
52
+ title: string;
53
+ };
54
+ } | undefined>;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @param {Record<string,any> |null} [jsonformSchema]
3
+ **/
4
+ export function getBboxProperty(jsonformSchema?: Record<string, any> | null): string;
5
+ /**
6
+ * Extracts the keys of type "geojson" from the jsonform schema
7
+ * @param {Record<string,any> |null} [jsonformSchema]
8
+ **/
9
+ export function getGeoJsonProperties(jsonformSchema?: Record<string, any> | null): string[];
10
+ /**
11
+ * Converts jsonform geojson values to stringified geometries
12
+ * @param {Record<string,any> |null} [jsonformSchema]
13
+ * @param {Record<string,any>} jsonformValue
14
+ **/
15
+ export function extractGeometries(jsonformValue: Record<string, any>, jsonformSchema?: Record<string, any> | null): void;
16
+ /**
17
+ *
18
+ * @param {*} link
19
+ * @param {*} layerId
20
+ * @param {string[]} urls
21
+ * @param {*} projection
22
+ * @param {*} processId
23
+ * @returns
24
+ */
25
+ export function createLayerDefinition(link: any, layerId: any, urls: string[], projection: any, processId: any): Promise<{
26
+ style?: Record<string, any> | undefined;
27
+ type: string;
28
+ source: {
29
+ type: string;
30
+ normalize: boolean;
31
+ sources: {
32
+ url: string;
33
+ }[];
34
+ };
35
+ properties: {
36
+ layerControlToolsExpand: boolean;
37
+ layerConfig?: Record<string, any> | undefined;
38
+ id: string;
39
+ title: string;
40
+ };
41
+ } | undefined>;
42
+ export function download(fileName: string, content: string | Record<string, any>): void;
@@ -1,21 +1,21 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
2
- body: unknown[];
2
+ body: string[];
3
3
  styleOverride: string;
4
- tags: unknown[];
5
- header: unknown[];
6
- footer: unknown[];
7
- featured: unknown[];
8
4
  allowHtml: boolean;
9
- subheader: unknown[];
5
+ header: string[];
6
+ tags: string[];
7
+ subheader: string[];
8
+ featured: string[];
9
+ footer: string[];
10
10
  $props: {
11
- readonly body?: unknown[] | undefined;
11
+ readonly body?: string[] | undefined;
12
12
  readonly styleOverride?: string | undefined;
13
- readonly tags?: unknown[] | undefined;
14
- readonly header?: unknown[] | undefined;
15
- readonly footer?: unknown[] | undefined;
16
- readonly featured?: unknown[] | undefined;
17
13
  readonly allowHtml?: boolean | undefined;
18
- readonly subheader?: unknown[] | undefined;
14
+ readonly header?: string[] | undefined;
15
+ readonly tags?: string[] | undefined;
16
+ readonly subheader?: string[] | undefined;
17
+ readonly featured?: string[] | undefined;
18
+ readonly footer?: string[] | undefined;
19
19
  };
20
20
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, HTMLDivElement>;
21
21
  export default _default;
@@ -1,17 +1,55 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
2
+ showIndicatorsBtn: boolean;
3
+ showLayoutSwitcher: boolean;
2
4
  layoutTarget: string;
3
5
  layoutIcon: string;
4
- itemFilterConfig: Record<string, any>;
5
- showLayoutSwitcher: boolean;
6
6
  indicatorBtnText: string;
7
- showIndicatorsBtn: boolean;
7
+ itemFilterConfig: Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never> & {
8
+ readonly enableCompare?: boolean | undefined;
9
+ readonly filtersTitle?: string | undefined;
10
+ readonly resultsTitle?: string | undefined;
11
+ readonly titleProperty?: string | undefined;
12
+ readonly imageProperty?: string | undefined;
13
+ readonly subTitleProperty?: string | undefined;
14
+ readonly resultType?: string | undefined;
15
+ readonly cssVars?: string | Record<string, any> | undefined;
16
+ readonly enableHighlighting?: boolean | undefined;
17
+ readonly expandMultipleFilters?: boolean | undefined;
18
+ readonly expandMultipleResults?: boolean | undefined;
19
+ readonly filterProperties?: {
20
+ keys: string[];
21
+ title: string;
22
+ type: string;
23
+ expanded?: boolean;
24
+ }[] | undefined;
25
+ readonly aggregateResults?: string | undefined;
26
+ };
8
27
  $props: {
28
+ readonly showIndicatorsBtn?: boolean | undefined;
29
+ readonly showLayoutSwitcher?: boolean | undefined;
9
30
  readonly layoutTarget?: string | undefined;
10
31
  readonly layoutIcon?: string | undefined;
11
- readonly itemFilterConfig?: Record<string, any> | undefined;
12
- readonly showLayoutSwitcher?: boolean | undefined;
13
32
  readonly indicatorBtnText?: string | undefined;
14
- readonly showIndicatorsBtn?: boolean | undefined;
33
+ readonly itemFilterConfig?: (Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never> & {
34
+ readonly enableCompare?: boolean | undefined;
35
+ readonly filtersTitle?: string | undefined;
36
+ readonly resultsTitle?: string | undefined;
37
+ readonly titleProperty?: string | undefined;
38
+ readonly imageProperty?: string | undefined;
39
+ readonly subTitleProperty?: string | undefined;
40
+ readonly resultType?: string | undefined;
41
+ readonly cssVars?: string | Record<string, any> | undefined;
42
+ readonly enableHighlighting?: boolean | undefined;
43
+ readonly expandMultipleFilters?: boolean | undefined;
44
+ readonly expandMultipleResults?: boolean | undefined;
45
+ readonly filterProperties?: {
46
+ keys: string[];
47
+ title: string;
48
+ type: string;
49
+ expanded?: boolean;
50
+ }[] | undefined;
51
+ readonly aggregateResults?: string | undefined;
52
+ }) | undefined;
15
53
  };
16
54
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {
17
55
  rootEl: HTMLDivElement;
@@ -4,16 +4,16 @@ type __VLS_WithTemplateSlots<T, S> = T & (new () => {
4
4
  $slots: S;
5
5
  });
6
6
  declare const __VLS_component: import("vue").DefineComponent<{}, {
7
+ maxWidth: string;
8
+ maxHeight: string;
7
9
  width: string;
8
10
  height: string;
9
- maxHeight: string;
10
- maxWidth: string;
11
11
  widget?: import("../core/client/types").Widget<"compiletime"> | undefined;
12
12
  $props: {
13
+ readonly maxWidth?: string | undefined;
14
+ readonly maxHeight?: string | undefined;
13
15
  readonly width?: string | undefined;
14
16
  readonly height?: string | undefined;
15
- readonly maxHeight?: string | undefined;
16
- readonly maxWidth?: string | undefined;
17
17
  readonly widget?: import("../core/client/types").Widget<"compiletime"> | undefined;
18
18
  };
19
19
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, HTMLSpanElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eodash/eodash",
3
- "version": "5.0.0-rc.2.5",
3
+ "version": "5.0.0",
4
4
  "type": "module",
5
5
  "types": "./dist/types/core/client/types.d.ts",
6
6
  "files": [
@@ -56,65 +56,65 @@
56
56
  "docs:dev": "vitepress dev docs --port 3333",
57
57
  "docs:build": "npm run docs:generate && vitepress build docs",
58
58
  "docs:preview": "vitepress preview docs",
59
- "docs:generate": "typedoc --options typedoc.config.json"
59
+ "docs:generate": "npm run build:cli && npm run build:types && typedoc --options typedoc.config.json"
60
60
  },
61
61
  "dependencies": {
62
62
  "@eox/chart": "^0.4.0",
63
- "@eox/drawtools": "^0.14.0",
64
- "@eox/itemfilter": "^1.7.1",
65
- "@eox/jsonform": "^0.15.4",
66
- "@eox/layercontrol": "^0.29.0",
63
+ "@eox/drawtools": "^0.14.2",
64
+ "@eox/itemfilter": "^1.8.0",
65
+ "@eox/jsonform": "^0.16.1",
66
+ "@eox/layercontrol": "^0.29.1",
67
67
  "@eox/layout": "^0.3.0",
68
- "@eox/map": "^1.19.4",
68
+ "@eox/map": "^1.20.0",
69
69
  "@eox/stacinfo": "^0.6.2",
70
70
  "@eox/timecontrol": "^0.12.3",
71
71
  "@mdi/js": "^7.4.47",
72
- "@vitejs/plugin-vue": "^5.2.1",
72
+ "@vitejs/plugin-vue": "^5.2.3",
73
73
  "@vueuse/core": "^12.0.0",
74
74
  "animated-details": "gist:2912bb049fa906671807415eb0e87188",
75
- "axios": "^1.7.9",
76
- "axios-cache-interceptor": "^1.6.2",
75
+ "axios": "^1.8.4",
76
+ "axios-cache-interceptor": "^1.7.0",
77
77
  "color-legend-element": "^1.3.0",
78
78
  "commander": "^12.1.0",
79
- "core-js": "^3.40.0",
79
+ "core-js": "^3.41.0",
80
80
  "loglevel": "^1.9.2",
81
81
  "mustache": "^4.2.0",
82
- "pinia": "^2.3.1",
83
- "sass": "^1.85.1",
82
+ "pinia": "^3.0.1",
83
+ "sass": "^1.86.0",
84
84
  "stac-js": "^0.0.9",
85
85
  "stac-ts": "^1.0.4",
86
86
  "v-calendar": "3.0.0",
87
- "vega": "^5.32.0",
87
+ "vega": "^5.33.0",
88
88
  "vega-embed": "^6.29.0",
89
89
  "vega-lite": "^5.23.0",
90
- "vite": "^6.2.0",
90
+ "vite": "^6.2.3",
91
91
  "vite-plugin-vuetify": "^2.1.0",
92
92
  "vue": "^3.5.0",
93
- "vuetify": "^3.7.13",
93
+ "vuetify": "^3.7.18",
94
94
  "webfontloader": "^1.6.28"
95
95
  },
96
96
  "devDependencies": {
97
- "@babel/types": "^7.26.9",
97
+ "@babel/types": "^7.27.0",
98
98
  "@eox/eslint-config": "^2.0.0",
99
99
  "@pinia/testing": "^0.1.7",
100
100
  "@types/json-schema": "^7.0.15",
101
101
  "@types/mustache": "^4.2.5",
102
- "@types/node": "^22.13.5",
102
+ "@types/node": "^22.13.13",
103
103
  "@types/openlayers": "^4.6.23",
104
104
  "@types/webfontloader": "^1.6.38",
105
105
  "cypress": "^13.17.0",
106
- "eslint": "^9.21.0",
107
- "eslint-plugin-vue": "^9.32.0",
106
+ "eslint": "^9.23.0",
107
+ "eslint-plugin-vue": "^9.33.0",
108
108
  "pkg-pr-new": "^0.0.39",
109
- "prettier": "^3.5.2",
110
- "rollup": "^4.34.8",
109
+ "prettier": "^3.5.3",
110
+ "rollup": "^4.37.0",
111
111
  "terminate": "^2.8.0",
112
- "tsc-alias": "^1.8.10",
113
- "typedoc": "^0.27.9",
114
- "typedoc-plugin-markdown": "^4.4.2",
115
- "typedoc-plugin-vue": "^1.4.0",
112
+ "tsc-alias": "^1.8.11",
113
+ "typedoc": "^0.28.1",
114
+ "typedoc-plugin-markdown": "^4.6.0",
115
+ "typedoc-plugin-vue": "^1.5.0",
116
116
  "typedoc-vitepress-theme": "^1.1.2",
117
- "typescript": "^5.7.3",
117
+ "typescript": "^5.8.2",
118
118
  "unplugin-fonts": "^1.3.1",
119
119
  "vitepress": "^1.6.3",
120
120
  "vitest": "^1.6.1",
@@ -28,12 +28,15 @@ import {
28
28
  eodashCollections,
29
29
  eodashCompareCollections,
30
30
  layerControlFormValue,
31
+ layerControlFormValueCompare,
31
32
  } from "@/utils/states";
32
33
  import { storeToRefs } from "pinia";
33
34
  import { useSTAcStore } from "@/store/stac";
34
35
 
35
36
  const props = defineProps({
36
37
  map: {
38
+ /** @type {import("vue").PropType<"first" | "second">} */
39
+ //@ts-expect-error todo
37
40
  type: String,
38
41
  default: "first",
39
42
  },
@@ -119,7 +122,11 @@ const debouncedHandleDateTime = (evt) => {
119
122
  * @param {Event & {detail:{layer:import("ol/layer").Layer;jsonformValue:Record<string,any>}}} evt
120
123
  */
121
124
  const onLayerConfigChange = (evt) => {
122
- layerControlFormValue.value = evt.detail.jsonformValue;
125
+ if (props.map === "second") {
126
+ layerControlFormValueCompare.value = evt.detail.jsonformValue;
127
+ } else {
128
+ layerControlFormValue.value = evt.detail.jsonformValue;
129
+ }
123
130
  };
124
131
 
125
132
  const styleOverride = `
@@ -15,8 +15,8 @@
15
15
  .controls="controls"
16
16
  >
17
17
  <eox-map-tooltip
18
- :style="tooltipStyles"
19
- .propertyTransform="tooltipPropertyTransform"
18
+ :style="mainTooltipStyles"
19
+ .propertyTransform="tooltipPropertyTransform('main')"
20
20
  />
21
21
  </eox-map>
22
22
  <eox-map
@@ -26,11 +26,11 @@
26
26
  ref="compareMap"
27
27
  .layers="eoxMapCompareLayers"
28
28
  >
29
- <eox-map-tooltip
30
- :style="tooltipStyles"
31
- .propertyTransform="tooltipPropertyTransform"
29
+ <eox-map-tooltip
30
+ :style="compareTooltipStyles"
31
+ .propertyTransform="tooltipPropertyTransform('compare')"
32
32
  />
33
- </eox-map>
33
+ </eox-map>
34
34
  </eox-map-compare>
35
35
  </template>
36
36
  <script setup>
@@ -44,12 +44,13 @@ import {
44
44
  eodashCollections,
45
45
  eodashCompareCollections,
46
46
  layerControlFormValue,
47
+ layerControlFormValueCompare,
47
48
  } from "@/utils/states";
48
49
  import {
49
50
  useHandleMapMoveEnd,
50
51
  useInitMap,
51
52
  useUpdateTooltipProperties,
52
- } from "@/composables/EodashMap";
53
+ } from "^/EodashMap/methods";
53
54
  import { inAndOut } from "ol/easing.js";
54
55
  import mustache from "mustache";
55
56
 
@@ -76,6 +77,8 @@ const props = defineProps({
76
77
 
77
78
  /** @type {import("vue").Ref<Exclude<import("@/types").EodashStyleJson["tooltip"], undefined>>} */
78
79
  const tooltipProperties = ref([]);
80
+ /** @type {import("vue").Ref<Exclude<import("@/types").EodashStyleJson["tooltip"], undefined>>} */
81
+ const compareTooltipProperties = ref([]);
79
82
  /** @type {import("@eox/map").EOxMap["controls"]} */
80
83
  const controls = {
81
84
  Attribution: {
@@ -147,6 +150,8 @@ onMounted(() => {
147
150
  eoxMap,
148
151
  false,
149
152
  );
153
+
154
+ useUpdateTooltipProperties(eodashCollections, compareTooltipProperties);
150
155
  }
151
156
 
152
157
  useInitMap(
@@ -163,35 +168,50 @@ onMounted(() => {
163
168
 
164
169
  useUpdateTooltipProperties(eodashCollections, tooltipProperties);
165
170
 
166
- const tooltipStyles = computed(() => ({
171
+ const mainTooltipStyles = computed(() => ({
167
172
  visibility: tooltipProperties.value.length ? "visible" : "hidden",
168
173
  }));
174
+
175
+ const compareTooltipStyles = computed(() => ({
176
+ visibility: compareTooltipProperties.value.length ? "visible" : "hidden",
177
+ }));
169
178
  /**
170
- * @param {{key:string; value:string}} param
171
- * @returns {{key:string; value?:string} | undefined}
172
- */
173
- const tooltipPropertyTransform = (param) => {
174
- /** @type {typeof tooltipProperties.value} */
175
- const updatedProperties = JSON.parse(
176
- mustache.render(JSON.stringify(tooltipProperties.value), {
177
- ...(layerControlFormValue.value ?? {}),
178
- }),
179
- );
179
+ * @param {"main" | "compare"} map
180
+ **/
181
+ const tooltipPropertyTransform = (map) => {
182
+ const tooltipProps =
183
+ map === "main" ? tooltipProperties : compareTooltipProperties;
184
+ const layerControlFormVal =
185
+ map == "main" ? layerControlFormValue : layerControlFormValueCompare;
186
+ /**
187
+ * @param {{key:string; value:string}} param
188
+ * @returns {{key:string; value?:string} | undefined}
189
+ */
190
+ return (param) => {
191
+ /** @type {typeof tooltipProps.value} */
192
+ const updatedProperties = JSON.parse(
193
+ mustache.render(JSON.stringify(tooltipProps.value), {
194
+ ...(layerControlFormVal.value ?? {}),
195
+ }),
196
+ );
180
197
 
181
- const tooltipProp = updatedProperties?.find((prop) => prop.id === param.key);
182
- if (!tooltipProp) {
183
- return undefined;
184
- }
185
- if (typeof param.value === "object") {
186
- param.value = JSON.stringify(param.value);
187
- }
188
- if (!isNaN(Number(param.value))) {
189
- param.value = Number(param.value).toFixed(4).toString();
190
- }
198
+ const tooltipProp = updatedProperties?.find(
199
+ (prop) => prop.id === param.key,
200
+ );
201
+ if (!tooltipProp) {
202
+ return undefined;
203
+ }
204
+ if (typeof param.value === "object") {
205
+ param.value = JSON.stringify(param.value);
206
+ }
207
+ if (!isNaN(Number(param.value))) {
208
+ param.value = Number(param.value).toFixed(4).toString();
209
+ }
191
210
 
192
- return {
193
- key: tooltipProp.title || tooltipProp.id,
194
- value: param.value + " " + (tooltipProp.appendix || ""),
211
+ return {
212
+ key: tooltipProp.title || tooltipProp.id,
213
+ value: param.value + " " + (tooltipProp.appendix || ""),
214
+ };
195
215
  };
196
216
  };
197
217
  </script>
@@ -0,0 +1,151 @@
1
+ import { EodashCollection } from "@/eodashSTAC/EodashCollection";
2
+ import log from "loglevel";
3
+
4
+ /**
5
+ * Creates full layer configuration from indicator and time information
6
+ * @param {import("stac-ts").StacCatalog
7
+ * | import("stac-ts").StacCollection
8
+ * | import("stac-ts").StacItem
9
+ * | null
10
+ * } selectedIndicator
11
+ * @param {EodashCollection[]} eodashCols
12
+ * @param {string} [updatedTime]
13
+ */
14
+
15
+ export const createLayersConfig = async (
16
+ selectedIndicator,
17
+ eodashCols,
18
+ updatedTime,
19
+ ) => {
20
+ log.debug(
21
+ "Creating layers config",
22
+ selectedIndicator,
23
+ eodashCols,
24
+ updatedTime,
25
+ );
26
+ const layersCollection = [];
27
+ const dataLayers = {
28
+ type: "Group",
29
+ properties: {
30
+ id: "AnalysisGroup",
31
+ title: "Data Layers",
32
+ layerControlExpand: true,
33
+ },
34
+ layers: /** @type {Record<string,any>[]}*/ ([]),
35
+ };
36
+
37
+ for (const ec of eodashCols) {
38
+ let layers;
39
+ if (updatedTime) {
40
+ layers = await ec.createLayersJson(new Date(updatedTime));
41
+ } else {
42
+ layers = await ec.createLayersJson();
43
+ }
44
+ // Add expand to all analysis layers
45
+ layers.forEach((dl) => {
46
+ dl.properties.layerControlExpand = true;
47
+ dl.properties.layerControlToolsExpand = true;
48
+ });
49
+ dataLayers.layers.push(...layers);
50
+ }
51
+
52
+ layersCollection.push(dataLayers);
53
+ const indicatorLayers =
54
+ //@ts-expect-error indicator is collection
55
+ await EodashCollection.getIndicatorLayers(selectedIndicator);
56
+ const geodbLayer = EodashCollection.getGeoDBLayer(eodashCols);
57
+ if (geodbLayer) {
58
+ dataLayers.layers.unshift(geodbLayer);
59
+ }
60
+ const baseLayers = {
61
+ type: "Group",
62
+ properties: {
63
+ id: "BaseLayersGroup",
64
+ title: "Base Layers",
65
+ },
66
+ layers: /** @type {Record<string,any>[]}*/ ([]),
67
+ };
68
+
69
+ const indicatorBaseLayers = indicatorLayers.filter(
70
+ (l) => l.properties.group === "baselayer",
71
+ );
72
+
73
+ if (indicatorBaseLayers.length) {
74
+ // Only one baselayer can be set to visible, let's first set all to
75
+ // false that have not a dedicated property visible, then check
76
+ // if there are more then one visible and only allow one
77
+ let counter = 0;
78
+ let lastPos = 0;
79
+ for (let indx = 0; indx < indicatorBaseLayers.length; indx++) {
80
+ const bl = indicatorBaseLayers[indx];
81
+ if (!("visible" in bl.properties)) {
82
+ bl.properties.visible = false;
83
+ }
84
+
85
+ if (bl.properties.visible) {
86
+ counter++;
87
+ lastPos = indx;
88
+ }
89
+ }
90
+
91
+ // if none visible set the last one as visible
92
+ if (counter === 0) {
93
+ indicatorBaseLayers[0].properties.visible = true;
94
+ }
95
+
96
+ // disable all apart from last
97
+ if (counter > 0) {
98
+ indicatorBaseLayers.forEach((bl, indx) => {
99
+ if (indx !== lastPos) {
100
+ bl.properties.visible = false;
101
+ } else {
102
+ bl.properties.visible = true;
103
+ }
104
+ });
105
+ }
106
+
107
+ baseLayers.layers.push(...indicatorBaseLayers);
108
+
109
+ // Add exclusive to baselayers and make sure only one is selected
110
+ baseLayers.layers.forEach((bl) => {
111
+ bl.properties.layerControlExclusive = true;
112
+ });
113
+ } else {
114
+ // Default to some baselayer
115
+ baseLayers.layers.push({
116
+ type: "Tile",
117
+ properties: {
118
+ id: "osm",
119
+ title: "Background",
120
+ layerControlExclusive: true,
121
+ },
122
+ source: {
123
+ type: "OSM",
124
+ },
125
+ });
126
+ }
127
+
128
+ if (baseLayers.layers.length) {
129
+ layersCollection.push(baseLayers);
130
+ }
131
+
132
+ const overlayLayers = {
133
+ type: "Group",
134
+ properties: {
135
+ id: "OverlayGroup",
136
+ title: "Overlay Layers",
137
+ },
138
+ layers: /** @type {Record<string,any>[]}*/ ([]),
139
+ };
140
+
141
+ const indicatorOverlays = indicatorLayers.filter(
142
+ (l) => l.properties.group === "overlay",
143
+ );
144
+
145
+ if (indicatorOverlays.length) {
146
+ overlayLayers.layers.push(...indicatorOverlays);
147
+ layersCollection.unshift(overlayLayers);
148
+ }
149
+
150
+ return layersCollection;
151
+ };