@eodash/eodash 5.3.3 → 5.4.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 (58) hide show
  1. package/core/client/composables/DefineEodash.js +3 -1
  2. package/core/client/eodashSTAC/EodashCollection.js +18 -35
  3. package/core/client/eodashSTAC/createLayers.js +278 -135
  4. package/core/client/eodashSTAC/helpers.js +53 -40
  5. package/core/client/eodashSTAC/parquet.js +1 -0
  6. package/core/client/eodashSTAC/triggers.js +7 -6
  7. package/core/client/types.ts +3 -1
  8. package/dist/client/{DashboardLayout-Cp8Rv3Ef.js → DashboardLayout-CQOGHPW_.js} +2 -2
  9. package/dist/client/{DynamicWebComponent-CBsxC82P.js → DynamicWebComponent-CoLO8FEf.js} +1 -1
  10. package/dist/client/{EodashDatePicker-Dewym-cx.js → EodashDatePicker-BZeQ6bcu.js} +3 -3
  11. package/dist/client/{EodashItemFilter-CAsZpOoQ.js → EodashItemFilter-CmZkk7GK.js} +1 -1
  12. package/dist/client/{EodashLayerControl-fn-rt8Ac.js → EodashLayerControl-D54fY-bX.js} +2 -2
  13. package/dist/client/{EodashLayoutSwitcher-B9XqQXCS.js → EodashLayoutSwitcher-BCP3FvDb.js} +3 -3
  14. package/dist/client/{EodashMapBtns-nFY6MIAX.js → EodashMapBtns-D-HulIl1.js} +14 -9
  15. package/dist/client/{EodashStacInfo-lxBKoav9.js → EodashStacInfo-BZbmT8vT.js} +1 -1
  16. package/dist/client/{EodashTimeSlider-DI97QkNT.js → EodashTimeSlider-DIcAJr6D.js} +2 -2
  17. package/dist/client/{EodashTools-D5ShUT1g.js → EodashTools-Cz6X6hsF.js} +4 -4
  18. package/dist/client/{ExportState-ruNyRS2E.js → ExportState-DFVFAgKz.js} +4 -4
  19. package/dist/client/{Footer-IQNyfd78.js → Footer-DLzQcjkI.js} +1 -1
  20. package/dist/client/{Header-BBdi_-Lp.js → Header-_D9Z-zFJ.js} +2 -2
  21. package/dist/client/{MobileLayout-BfBeF-JF.js → MobileLayout-3Ko9XSfO.js} +2 -2
  22. package/dist/client/{PopUp-DRgOmD7-.js → PopUp-DwI8V2gW.js} +2 -2
  23. package/dist/client/{ProcessList-DxyCFQdz.js → ProcessList-C9eAg2Sb.js} +4 -4
  24. package/dist/client/{VImg-hwmwzSwG.js → VImg-COXTnCWE.js} +2 -2
  25. package/dist/client/{VMain-vk4-rkw-.js → VMain-C74l1bv-.js} +1 -1
  26. package/dist/client/{VTooltip-BYUZeia1.js → VTooltip-BLS-cQ9N.js} +2 -2
  27. package/dist/client/{WidgetsContainer-DXD_8rqh.js → WidgetsContainer-D-VfMRxE.js} +1 -1
  28. package/dist/client/{asWebComponent-DdguWGDI.js → asWebComponent-Bw03Jutr.js} +304 -181
  29. package/dist/client/{async-D1MvO_Z_.js → async-D4G-FOIc.js} +13 -3
  30. package/dist/client/eo-dash.js +1 -1
  31. package/dist/client/{forwardRefs-DM-E2MfG.js → forwardRefs-CRMFoNYN.js} +2 -2
  32. package/dist/client/{handling-CbgeKrqT.js → handling-DTAhQuPh.js} +94 -10
  33. package/dist/client/{helpers-CtUlAW0N.js → helpers-CsjKHAcK.js} +60 -47
  34. package/dist/client/{index-BJvLt3Xf.js → index-BHilH1qx.js} +17 -13
  35. package/dist/client/{index-BkW06-Lg.js → index-BIcmbjr0.js} +34 -7
  36. package/dist/client/{index-BxDh5v-H.js → index-BoCcZ0l4.js} +3 -3
  37. package/dist/client/{index-DBo0F4Fv.js → index-DEmHaCL3.js} +2 -2
  38. package/dist/client/templates.js +5 -1
  39. package/dist/client/{transition-BdzATvPB.js → transition-6MJLK-_H.js} +1 -1
  40. package/dist/types/core/client/composables/DefineEodash.d.ts +1 -1
  41. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +27 -11
  42. package/dist/types/core/client/eodashSTAC/createLayers.d.ts +30 -23
  43. package/dist/types/core/client/eodashSTAC/helpers.d.ts +10 -4
  44. package/dist/types/core/client/types.d.ts +1 -1
  45. package/dist/types/widgets/EodashMap/EodashMapBtns.vue.d.ts +2 -0
  46. package/dist/types/widgets/EodashMap/index.vue.d.ts +2 -0
  47. package/dist/types/widgets/EodashProcess/methods/handling.d.ts +13 -0
  48. package/dist/types/widgets/EodashProcess/methods/utils.d.ts +1 -0
  49. package/package.json +1 -1
  50. package/templates/expert.js +4 -0
  51. package/widgets/EodashMap/EodashMapBtns.vue +15 -0
  52. package/widgets/EodashMap/index.vue +4 -0
  53. package/widgets/EodashMap/methods/create-layers-config.js +23 -0
  54. package/widgets/EodashProcess/index.vue +1 -9
  55. package/widgets/EodashProcess/methods/composables.js +13 -1
  56. package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +15 -6
  57. package/widgets/EodashProcess/methods/handling.js +77 -0
  58. package/widgets/EodashProcess/methods/utils.js +10 -0
@@ -9,13 +9,21 @@ export class EodashCollection {
9
9
  type: string;
10
10
  source: {
11
11
  type: string;
12
- url: string;
13
- projection: string;
12
+ url: string | undefined;
13
+ format: {
14
+ type: string;
15
+ dataProjection: string;
16
+ };
14
17
  attributions: unknown;
15
18
  };
16
19
  properties: {
17
20
  layerConfig?: {
18
21
  style: import("../types").EodashStyleJson | undefined;
22
+ } | {
23
+ style: import("../types").EodashStyleJson | undefined;
24
+ schema: any;
25
+ legend: any;
26
+ type: string;
19
27
  } | undefined;
20
28
  id: string;
21
29
  title: string;
@@ -27,16 +35,18 @@ export class EodashCollection {
27
35
  type: string;
28
36
  source: {
29
37
  type: string;
30
- url: string | undefined;
31
- format: {
32
- type: string;
33
- dataProjection: string | undefined;
34
- };
35
- attributions: {}[];
38
+ projection: string;
39
+ attributions: unknown;
40
+ url: string;
36
41
  };
37
42
  properties: {
38
43
  layerConfig?: {
39
44
  style: import("../types").EodashStyleJson | undefined;
45
+ } | {
46
+ style: import("../types").EodashStyleJson | undefined;
47
+ schema: any;
48
+ legend: any;
49
+ type: string;
40
50
  } | undefined;
41
51
  id: string;
42
52
  title: string;
@@ -51,12 +61,19 @@ export class EodashCollection {
51
61
  sources: {
52
62
  url: string;
53
63
  attributions: unknown;
64
+ } | {
65
+ url: string;
66
+ attributions: unknown;
54
67
  }[];
55
68
  };
56
69
  properties: {
57
70
  id: string;
58
71
  title: string;
59
- layerConfig: Record<string, unknown> | undefined;
72
+ layerConfig: Record<string, unknown> | {
73
+ schema: any;
74
+ legend: any;
75
+ type: string;
76
+ } | undefined;
60
77
  layerDatetime: Record<string, unknown> | undefined;
61
78
  };
62
79
  style: import("../types").EodashStyleJson | undefined;
@@ -122,13 +139,12 @@ export class EodashCollection {
122
139
  createLayersJson: (itemOrDate?: import("stac-ts").StacItem | import("stac-ts").StacLink | Date) => Promise<Record<string, any>[]>;
123
140
  /**
124
141
  * @param {import("stac-ts").StacItem} item
125
- * @param {string} itemUrl
126
142
  * @param {string} title
127
143
  * @param {boolean} isObservationPoint
128
144
  * @param {string} [itemDatetime]
129
145
  * @returns {Promise<Record<string,any>[]>} layers
130
146
  * */
131
- buildJsonArray(item: import("stac-ts").StacItem, itemUrl: string, title: string, isObservationPoint: boolean, itemDatetime?: string): Promise<Record<string, any>[]>;
147
+ buildJsonArray(item: import("stac-ts").StacItem, title: string, isObservationPoint: boolean, itemDatetime?: string): Promise<Record<string, any>[]>;
132
148
  fetchCollection(): Promise<import("stac-ts").StacCollection>;
133
149
  /**
134
150
  * Returns all item links sorted by datetime ascendingly
@@ -2,25 +2,31 @@
2
2
  * @param {string} collectionId
3
3
  * @param {string} title
4
4
  * @param {Record<string,import("stac-ts").StacAsset>} assets
5
- * @param {import("stac-ts").StacItem } item
6
- * @param {import("../types").EodashStyleJson} [style]
7
- * @param {Record<string, unknown>} [layerConfig]
5
+ * @param {import("stac-ts").StacItem | import("stac-ts").StacCollection } stacObject
8
6
  * @param {Record<string, unknown>} [layerDatetime]
9
7
  * @param {object | null} [extraProperties]
10
8
  **/
11
- export function createLayersFromAssets(collectionId: string, title: string, assets: Record<string, import("stac-ts").StacAsset>, item: import("stac-ts").StacItem, style?: import("../types").EodashStyleJson, layerConfig?: Record<string, unknown>, layerDatetime?: Record<string, unknown>, extraProperties?: object | null): Promise<({
9
+ export function createLayersFromAssets(collectionId: string, title: string, assets: Record<string, import("stac-ts").StacAsset>, stacObject: import("stac-ts").StacItem | import("stac-ts").StacCollection, layerDatetime?: Record<string, unknown>, extraProperties?: object | null): Promise<({
12
10
  interactions: never[];
13
11
  style?: import("../types").EodashStyleJson | undefined;
14
12
  type: string;
15
13
  source: {
16
14
  type: string;
17
- url: string;
18
- projection: string;
15
+ url: string | undefined;
16
+ format: {
17
+ type: string;
18
+ dataProjection: string;
19
+ };
19
20
  attributions: unknown;
20
21
  };
21
22
  properties: {
22
23
  layerConfig?: {
23
24
  style: import("../types").EodashStyleJson | undefined;
25
+ } | {
26
+ style: import("../types").EodashStyleJson | undefined;
27
+ schema: any;
28
+ legend: any;
29
+ type: string;
24
30
  } | undefined;
25
31
  id: string;
26
32
  title: string;
@@ -32,16 +38,18 @@ export function createLayersFromAssets(collectionId: string, title: string, asse
32
38
  type: string;
33
39
  source: {
34
40
  type: string;
35
- url: string | undefined;
36
- format: {
37
- type: string;
38
- dataProjection: string | undefined;
39
- };
40
- attributions: {}[];
41
+ projection: string;
42
+ attributions: unknown;
43
+ url: string;
41
44
  };
42
45
  properties: {
43
46
  layerConfig?: {
44
47
  style: import("../types").EodashStyleJson | undefined;
48
+ } | {
49
+ style: import("../types").EodashStyleJson | undefined;
50
+ schema: any;
51
+ legend: any;
52
+ type: string;
45
53
  } | undefined;
46
54
  id: string;
47
55
  title: string;
@@ -56,23 +64,22 @@ export function createLayersFromAssets(collectionId: string, title: string, asse
56
64
  sources: {
57
65
  url: string;
58
66
  attributions: unknown;
67
+ } | {
68
+ url: string;
69
+ attributions: unknown;
59
70
  }[];
60
71
  };
61
72
  properties: {
62
73
  id: string;
63
74
  title: string;
64
- layerConfig: Record<string, unknown> | undefined;
75
+ layerConfig: Record<string, unknown> | {
76
+ schema: any;
77
+ legend: any;
78
+ type: string;
79
+ } | undefined;
65
80
  layerDatetime: Record<string, unknown> | undefined;
66
81
  };
67
82
  style: import("../types").EodashStyleJson | undefined;
68
83
  })[]>;
69
- /**
70
- * Implementation of a function that creates a layer from the render extention
71
- * @param {import("stac-ts").StacCollection | undefined | null} collection
72
- * @param {import("stac-ts").StacItem | undefined | null} item
73
- * @param {string} rasterURL
74
- * @param {Record<string, any>} [extraProperties]
75
- * @returns {import("@eox/map/src/layers").EOxLayerType<"Tile","XYZ">[]}
76
- */
77
- export function createLayerFromRender(rasterURL: string, collection: import("stac-ts").StacCollection | undefined | null, item: import("stac-ts").StacItem | undefined | null, extraProperties?: Record<string, any>): import("@eox/map/src/layers").EOxLayerType<"Tile", "XYZ">[];
78
- export function createLayersFromLinks(collectionId: string, title: string, item: import("stac-ts").StacItem, itemUrl: string, layerDatetime?: Record<string, any>, extraProperties?: object | null): Promise<Record<string, any>[]>;
84
+ export function createLayersFromLinks(collectionId: string, title: string, item: import("stac-ts").StacItem, layerDatetime?: Record<string, any>, extraProperties?: object | null, collection?: import("stac-ts").StacCollection): Promise<Record<string, any>[]>;
85
+ export function createLayerFromRender(rasterURL: string, collection: import("stac-ts").StacCollection | undefined | null, item: import("stac-ts").StacItem | undefined | null, extraProperties?: Record<string, any>): Promise<import("@eox/map/src/layers").EOxLayerType<"Tile", "XYZ">[]>;
@@ -14,13 +14,14 @@ export function generateFeatures(links?: import("stac-ts").StacLink[], extraProp
14
14
  features: import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>[];
15
15
  };
16
16
  /**
17
- * Sperates and extracts layerConfig (jsonform schema & legend) from a style json
17
+ * Spearates and extracts layerConfig (jsonform schema & legend) from a style json
18
18
  *
19
19
  * @param {string} collectionId
20
20
  * @param { import("../types").EodashStyleJson} [style]
21
21
  * @param {Record<string,any>} [rasterJsonform]
22
+ * @param {string} [layerConfigType]
22
23
  * */
23
- export function extractLayerConfig(collectionId: string, style?: import("../types").EodashStyleJson, rasterJsonform?: Record<string, any>): {
24
+ export function extractLayerConfig(collectionId: string, style?: import("../types").EodashStyleJson, rasterJsonform?: Record<string, any>, layerConfigType?: string): {
24
25
  layerConfig: {
25
26
  schema: any;
26
27
  legend: any;
@@ -92,9 +93,14 @@ export function fetchApiItems(itemsUrl: string, query?: string, limit?: number,
92
93
  * @returns {object}
93
94
  */
94
95
  export function extractLayerLegend(collection: import("stac-ts").StacCollection | undefined | null): object;
96
+ /**
97
+ * @param { import ("stac-ts").StacLink } link
98
+ * @returns {object}
99
+ */
100
+ export function extractEoxLegendLink(link: import("stac-ts").StacLink): object;
95
101
  export function sanitizeBbox(bbox: number[]): number[];
96
102
  export function extractRoles(properties: Record<string, any>, linkOrAsset: import("stac-ts").StacLink | import("stac-ts").StacAsset): Record<string, any>;
97
- export function fetchStyle(item: import("stac-ts").StacItem, itemUrl: string, key?: string | undefined): Promise<{
103
+ export function fetchStyle(stacObject: import("stac-ts").StacItem | import("stac-ts").StacCollection, linkKey?: string | undefined, assetKey?: string | undefined): Promise<{
98
104
  "fill-color"?: import("ol/style/flat.js").ColorExpression | undefined;
99
105
  "fill-pattern-src"?: import("ol/style/flat.js").StringExpression | undefined;
100
106
  "fill-pattern-size"?: import("ol/style/flat.js").SizeExpression | undefined;
@@ -481,7 +487,7 @@ export function fetchStyle(item: import("stac-ts").StacItem, itemUrl: string, ke
481
487
  decimals?: number;
482
488
  }[];
483
489
  } | undefined>;
484
- export function fetchAllStyles(item: import("stac-ts").StacItem, itemUrl: string): Promise<Array<import("../types").EodashStyleJson>>;
490
+ export function fetchAllStyles(stacObject: import("stac-ts").StacItem | import("stac-ts").StacCollection): Promise<Array<import("../types").EodashStyleJson>>;
485
491
  export function getProjectionCode(projection?: string | number | {
486
492
  name: string;
487
493
  def: string;
@@ -383,7 +383,7 @@ export type EodashRasterJSONForm = {
383
383
  legend?: import("@eox/layercontrol/src/components/layer-config.js").EOxLayerControlLayerConfig["layerConfig"]["legend"];
384
384
  };
385
385
  /** @ignore */
386
- export type LayersEventBusKeys = "layers:updated" | "time:updated" | "process:updated" | "compareLayers:updated" | "compareTime:updated" | "compareProcess:updated";
386
+ export type LayersEventBusKeys = "layers:updated" | "time:updated" | "process:updated" | "layertime:updated" | "compareLayers:updated" | "compareTime:updated" | "compareProcess:updated" | "compareLayertime:updated";
387
387
  /** @ignore */
388
388
  export interface SearchParams {
389
389
  /** Collection IDs to search within */
@@ -9,6 +9,7 @@ declare const _default: import("vue").DefineComponent<{}, {
9
9
  backToPOIs: boolean;
10
10
  enableSearch: boolean;
11
11
  enableZoom: boolean;
12
+ searchParams: boolean | Record<string, any>;
12
13
  $props: {
13
14
  compareIndicators?: boolean | {
14
15
  compareTemplate?: string;
@@ -20,6 +21,7 @@ declare const _default: import("vue").DefineComponent<{}, {
20
21
  backToPOIs?: boolean | undefined;
21
22
  enableSearch?: boolean | undefined;
22
23
  enableZoom?: boolean | undefined;
24
+ searchParams?: boolean | Record<string, any> | undefined;
23
25
  };
24
26
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
25
27
  export default _default;
@@ -10,6 +10,7 @@ declare const _default: import("vue").DefineComponent<{}, {
10
10
  enableChangeProjection?: boolean;
11
11
  enableBackToPOIs?: boolean;
12
12
  enableSearch?: boolean;
13
+ searchParams?: object;
13
14
  enableZoom?: boolean;
14
15
  enableCompareIndicators?: boolean | {
15
16
  compareTemplate?: string;
@@ -72,6 +73,7 @@ declare const _default: import("vue").DefineComponent<{}, {
72
73
  enableChangeProjection?: boolean;
73
74
  enableBackToPOIs?: boolean;
74
75
  enableSearch?: boolean;
76
+ searchParams?: object;
75
77
  enableZoom?: boolean;
76
78
  enableCompareIndicators?: boolean | {
77
79
  compareTemplate?: string;
@@ -25,6 +25,19 @@ export function initProcess({ selectedStac, jsonformEl, jsonformSchema, chartSpe
25
25
  isPolling: import("vue").Ref<boolean>;
26
26
  enableCompare: boolean;
27
27
  }): Promise<void>;
28
+ /**
29
+ * Update the jsonform schema to have the correct layer id from the map
30
+ *
31
+ * @export
32
+ * @async
33
+ * @param {Object} params
34
+ * @param {import("vue").Ref<Record<string,any> | null>} params.jsonformSchema params.jsonformSchema
35
+ * @param {Record<string, any>[] | undefined} params.newLayers params.newLayers
36
+ */
37
+ export function updateJsonformIdentifier({ jsonformSchema, newLayers }: {
38
+ jsonformSchema: import("vue").Ref<Record<string, any> | null>;
39
+ newLayers: Record<string, any>[] | undefined;
40
+ }): Promise<void>;
28
41
  /**
29
42
  *
30
43
  * @param {object} params
@@ -59,4 +59,5 @@ export function extractAsyncResults(resultItem: import("../../EodashProcess/type
59
59
  */
60
60
  export function updateJsonformSchemaTarget(jsonformSchema: import("json-schema").JSONSchema7 | null | undefined): import("json-schema").JSONSchema7 | null | undefined;
61
61
  export function download(fileName: string, content: string | Record<string, any>): void;
62
+ export function getDrawToolsProperty(jsonformSchema: any): string | undefined;
62
63
  export function applyProcessLayersToMap(mapElement: import("@eox/map").EOxMap | null, processLayers: import("@eox/map").EoxLayer[]): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eodash/eodash",
3
- "version": "5.3.3",
3
+ "version": "5.4.0",
4
4
  "type": "module",
5
5
  "types": "./dist/types/core/client/types.d.ts",
6
6
  "files": [
@@ -35,6 +35,10 @@ export default {
35
35
  },
36
36
  enableBackToPOIs: true,
37
37
  enableSearch: true,
38
+ // searchParams: {
39
+ // countrycode: "gb,ie,fr"
40
+ // bounds: "-84.26514,41.58998,-77.54150,46.14246"
41
+ // },
38
42
  },
39
43
  btnsPosition: {
40
44
  x: "12/9/9",
@@ -69,6 +69,7 @@
69
69
  v-if="mapEl && enableSearch"
70
70
  :for="mapEl"
71
71
  :endpoint="opencageUrl"
72
+ :params="searchParams"
72
73
  class="geosearch-detached"
73
74
  label="Search"
74
75
  small
@@ -131,6 +132,7 @@ const {
131
132
  backToPOIs,
132
133
  enableSearch,
133
134
  enableZoom,
135
+ searchParams,
134
136
  } = defineProps({
135
137
  exportMap: {
136
138
  type: Boolean,
@@ -157,6 +159,10 @@ const {
157
159
  type: Boolean,
158
160
  default: true,
159
161
  },
162
+ searchParams: {
163
+ type: [Boolean, Object],
164
+ default: true,
165
+ },
160
166
  enableZoom: {
161
167
  type: Boolean,
162
168
  default: true,
@@ -263,11 +269,20 @@ const opencageUrl = `https://api.opencagedata.com/geocode/v1/json?key=${opencage
263
269
 
264
270
  <style scoped>
265
271
  @import url("@eox/ui/style.css");
272
+ /* Make sure panel does pass click event through */
273
+ .map-buttons {
274
+ pointer-events: none !important;
275
+ }
266
276
 
267
277
  .map-buttons button {
278
+ pointer-events: auto !important;
268
279
  margin-bottom: 5px;
269
280
  background-color: var(--primary);
270
281
  }
282
+ /* Make sure buttons have pointer event */
283
+ .geosearch-detached {
284
+ pointer-events: auto !important;
285
+ }
271
286
 
272
287
  /* Container constraints removal */
273
288
  eox-geosearch {
@@ -60,6 +60,7 @@
60
60
  "
61
61
  :enableZoom="(indicator || compareIndicator || poi) ? btnsProps.enableZoom : false
62
62
  "
63
+ :searchParams="btnsProps.searchParams"
63
64
  />
64
65
  </div>
65
66
  </span>
@@ -136,6 +137,7 @@ const props = defineProps({
136
137
  * enableChangeProjection?: boolean;
137
138
  * enableBackToPOIs?: boolean;
138
139
  * enableSearch?: boolean;
140
+ * searchParams?: object;
139
141
  * enableZoom?: boolean;
140
142
  * enableCompareIndicators?: boolean | {
141
143
  * compareTemplate?:string;
@@ -151,6 +153,7 @@ const props = defineProps({
151
153
  enableBackToPOIs: true,
152
154
  enableSearch: true,
153
155
  enableZoom: true,
156
+ searchParams: {},
154
157
  }),
155
158
  },
156
159
  });
@@ -192,6 +195,7 @@ const btnsProps = computed(() => ({
192
195
  backToPOIs: props.btns.enableBackToPOIs ?? true,
193
196
  enableSearch: props.btns.enableSearch ?? true,
194
197
  enableZoom: props.btns.enableZoom ?? true,
198
+ searchParams: props.btns.searchParams,
195
199
  }));
196
200
 
197
201
  // Prepare containers for scale line and cursor coordinates
@@ -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 +59,7 @@ import {
59
59
  chartEl,
60
60
  compareChartEl,
61
61
  } from "@/store/states";
62
- import { download } from "./methods/utils";
62
+ import { download, getDrawToolsProperty } from "./methods/utils";
63
63
  import { compareJobs, jobs } from "./states";
64
64
  import { mdiCogPlayOutline, mdiDownloadCircleOutline } from "@mdi/js";
65
65
 
@@ -155,14 +155,6 @@ const downloadResults = () => {
155
155
  };
156
156
 
157
157
  const startProcess = async () => {
158
- /** @param {*} jsonformSchema */
159
- const getDrawToolsProperty = (jsonformSchema) => {
160
- for (const property in jsonformSchema.properties) {
161
- if (jsonformSchema.properties[property]?.options?.drawtools) {
162
- return property;
163
- }
164
- }
165
- };
166
158
  const drawToolsProperty = getDrawToolsProperty(jsonformSchema.value);
167
159
  const propertyIsEmpty =
168
160
  drawToolsProperty &&
@@ -1,4 +1,4 @@
1
- import { initProcess } from "./handling";
1
+ import { initProcess, updateJsonformIdentifier } from "./handling";
2
2
  import { useEventBus } from "@vueuse/core";
3
3
  import { nextTick, onMounted, watch } from "vue";
4
4
  import { eoxLayersKey } from "@/utils/keys";
@@ -67,6 +67,18 @@ export const useInitProcess = ({
67
67
  const evtKey =
68
68
  mapElement?.id === "compare" ? "compareLayers:updated" : "layers:updated";
69
69
  useOnLayersUpdate(async (evt, _payload) => {
70
+ if (
71
+ evt == "layertime:updated" ||
72
+ evt == "compareLayertime:updated" ||
73
+ evt == "time:updated" ||
74
+ evt == "compareTime:updated"
75
+ ) {
76
+ await updateJsonformIdentifier({
77
+ jsonformSchema,
78
+ // @ts-expect-error TODO payload coming from time update events is not an object with layers property
79
+ newLayers: _payload,
80
+ });
81
+ }
70
82
  if (evt !== evtKey) {
71
83
  return;
72
84
  }
@@ -19,7 +19,7 @@ export async function handleVedaEndpoint({
19
19
  enableCompare = false,
20
20
  }) {
21
21
  const vedaLink = links.find(
22
- (link) => link.rel === "service" && link.endpoint === "veda",
22
+ (link) => link.rel === "service" && (link.endpoint === "veda" || link.endpoint === "veda_stac"),
23
23
  );
24
24
  if (!vedaLink) {
25
25
  return;
@@ -32,12 +32,17 @@ export async function handleVedaEndpoint({
32
32
  const configs = await fetchVedaCOGsConfig(
33
33
  selectedStac,
34
34
  enableCompare ? currentCompareUrl.value : currentUrl.value,
35
+ vedaLink,
35
36
  );
36
37
  // TODO: convert jsonform bbox type to geojson in the schema to avoid the conversion here
37
38
  return await Promise.all(
38
39
  configs.map(({ endpoint, datetime }) => {
40
+ const url = new URL(vedaEndpoint);
41
+ const key = vedaLink.endpoint === "veda_stac" ? "ids" : "url";
42
+ url.searchParams.set(key, endpoint);
43
+
39
44
  return axios
40
- .post(vedaEndpoint + `?url=${endpoint}`, {
45
+ .post(url.toString(), {
41
46
  ...{
42
47
  type: "Feature",
43
48
  properties: {},
@@ -63,8 +68,9 @@ export async function handleVedaEndpoint({
63
68
  * Fetches the COGs endpoints from the STAC collections
64
69
  * @param {import("stac-ts").StacCollection} selectedStac
65
70
  * @param {string} absoluteUrl
71
+ * @param {import("stac-ts").StacLink} vedaLink
66
72
  */
67
- async function fetchVedaCOGsConfig(selectedStac, absoluteUrl) {
73
+ async function fetchVedaCOGsConfig(selectedStac, absoluteUrl, vedaLink) {
68
74
  // retrieve the collections from the indicator
69
75
  const collectionLinks = selectedStac.links.filter(
70
76
  (link) => link.rel == "child",
@@ -110,10 +116,13 @@ async function fetchVedaCOGsConfig(selectedStac, absoluteUrl) {
110
116
  );
111
117
  const itemLinks = collection.links.filter((link) => link.rel == "item");
112
118
  configs.push(
113
- ...itemLinks.map((link) => ({
114
- endpoint: /** @type {string} */ (link["cog_href"]),
119
+ ...itemLinks.map((link) => {
120
+ const endpoint = /** @type {string} */ (vedaLink.endpoint === "veda_stac" ? link.id : link["cog_href"]);
121
+ return {
122
+ endpoint,
115
123
  datetime: /** @type string **/ (link[datetimeProperty]),
116
- })),
124
+ }
125
+ })
117
126
  );
118
127
  }
119
128
 
@@ -3,6 +3,7 @@ import {
3
3
  applyProcessLayersToMap,
4
4
  extractGeometries,
5
5
  getBboxProperty,
6
+ getDrawToolsProperty,
6
7
  updateJsonformSchemaTarget,
7
8
  } from "./utils";
8
9
  import {
@@ -18,6 +19,7 @@ import { handleLayersCustomEndpoints } from "./custom-endpoints/layers";
18
19
  import { handleChartCustomEndpoints } from "./custom-endpoints/chart";
19
20
  import { useSTAcStore } from "@/store/stac";
20
21
  import { useGetSubCodeId } from "@/composables";
22
+ import { getLayers } from "@/store/actions";
21
23
 
22
24
  /**
23
25
  * Fetch and set the jsonform schema to initialize the process
@@ -70,6 +72,13 @@ export async function initProcess({
70
72
 
71
73
  await jsonformEl.value?.editor.destroy();
72
74
  if (updatedJsonform) {
75
+ // make sure correct target layer id is used in jsonform
76
+ if (updatedJsonform.properties?.feature?.options?.drawtools?.layerId) {
77
+ await updateJsonformIdentifier({
78
+ jsonformSchema,
79
+ newLayers: await getLayers(),
80
+ });
81
+ }
73
82
  if (enableCompare) {
74
83
  updatedJsonform = updateJsonformSchemaTarget(updatedJsonform);
75
84
  }
@@ -77,6 +86,74 @@ export async function initProcess({
77
86
  }
78
87
  }
79
88
 
89
+ /**
90
+ * Update the jsonform schema to have the correct layer id from the map
91
+ *
92
+ * @export
93
+ * @async
94
+ * @param {Object} params
95
+ * @param {import("vue").Ref<Record<string,any> | null>} params.jsonformSchema params.jsonformSchema
96
+ * @param {Record<string, any>[] | undefined} params.newLayers params.newLayers
97
+ */
98
+ export async function updateJsonformIdentifier({ jsonformSchema, newLayers }) {
99
+ const form = jsonformSchema.value;
100
+ if (!form) {
101
+ return;
102
+ }
103
+ const drawToolsProperty = getDrawToolsProperty(form);
104
+ if (
105
+ drawToolsProperty &&
106
+ newLayers &&
107
+ form?.properties[drawToolsProperty]?.options?.drawtools?.layerId
108
+ ) {
109
+ // get partial or full id and try to match with correct eoxmap layer
110
+ // check if newLayers is an array or an object with layers property
111
+ let layers = newLayers;
112
+ // @ts-expect-error TODO payload coming from time update sometimes is not an object with layers property
113
+ if (newLayers.layers && Array.isArray(newLayers.layers)) {
114
+ // @ts-expect-error TODO payload coming from time update sometimes is not an object with layers property
115
+ layers = newLayers.layers;
116
+ }
117
+
118
+ const layerId =
119
+ form.properties[drawToolsProperty].options.drawtools.layerId.split(
120
+ ";:;",
121
+ )[0];
122
+ let matchedLayerId = null;
123
+ // layers are not flat can be grouped, we need to recursively search
124
+ const traverseLayers = (
125
+ /** @type {Record<string, any>[] | undefined} */ layersArray,
126
+ ) => {
127
+ if (!layersArray) {
128
+ return;
129
+ }
130
+ for (const layer of layersArray) {
131
+ if (layer.layers) {
132
+ // @ts-expect-error TODO payload coming from time update events is not an object with layers property
133
+ traverseLayers(layer);
134
+ } else {
135
+ if (layer.properties?.id?.startsWith(layerId)) {
136
+ matchedLayerId = layer.properties.id;
137
+ break;
138
+ }
139
+ }
140
+ }
141
+ };
142
+ traverseLayers(layers);
143
+ if (matchedLayerId) {
144
+ form.properties.feature.options.drawtools.layerId = matchedLayerId;
145
+ // trigger jsonform update in next tick
146
+ jsonformSchema.value = null;
147
+ await new Promise((resolve) => setTimeout(resolve, 0));
148
+ jsonformSchema.value = form;
149
+ } else {
150
+ throw new Error(
151
+ `Could not find matching layer for processing form with id: ${layerId}`,
152
+ );
153
+ }
154
+ }
155
+ }
156
+
80
157
  /**
81
158
  *
82
159
  * @param {object} params
@@ -508,6 +508,16 @@ export function extractAsyncResults(resultItem) {
508
508
  }
509
509
  return extracted;
510
510
  }
511
+
512
+ /** @param {*} jsonformSchema */
513
+ export const getDrawToolsProperty = (jsonformSchema) => {
514
+ for (const property in jsonformSchema.properties) {
515
+ if (jsonformSchema.properties[property]?.options?.drawtools) {
516
+ return property;
517
+ }
518
+ }
519
+ };
520
+
511
521
  /**
512
522
  * @param {import("@eox/map").EOxMap | null} mapElement
513
523
  * @param {import("@eox/map").EoxLayer[]} processLayers