@eodash/eodash 5.0.0-alpha.2.23 → 5.0.0-alpha.2.24

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 (33) hide show
  1. package/core/client/eodash.js +2 -2
  2. package/core/client/store/stac.js +0 -3
  3. package/core/client/types.d.ts +2 -2
  4. package/core/client/utils/createLayers.js +15 -5
  5. package/core/client/utils/eodashSTAC.js +14 -6
  6. package/core/client/utils/helpers.js +5 -1
  7. package/dist/client/{DashboardLayout-BZDjLPAM.js → DashboardLayout-DXDjBC-p.js} +2 -2
  8. package/dist/client/{DynamicWebComponent-B3pcDnnp.js → DynamicWebComponent-BJ5-IY6R.js} +1 -1
  9. package/dist/client/{EodashDatePicker-CYH67qUf.js → EodashDatePicker-I6KQaEyw.js} +3 -3
  10. package/dist/client/{EodashItemFilter-BPtyEU15.js → EodashItemFilter-CuX_el88.js} +1 -1
  11. package/dist/client/{EodashLayerControl-BMulJ7Nu.js → EodashLayerControl-QXaIbd4a.js} +3 -2
  12. package/dist/client/{EodashMap-CAlmeyEK.js → EodashMap-PD1dCjMS.js} +1 -1
  13. package/dist/client/{EodashMapBtns-Cb21hoLK.js → EodashMapBtns-DzguYarW.js} +2 -2
  14. package/dist/client/{ExportState-Cs26sTpI.js → ExportState-CzxCA7c4.js} +4 -4
  15. package/dist/client/{Footer-DeQud94i.js → Footer-DEajGQxT.js} +1 -1
  16. package/dist/client/{Header-BCbNDZVc.js → Header-B0UJlW9C.js} +3 -3
  17. package/dist/client/{MobileLayout-fwxBmlOE.js → MobileLayout-9o2BIRae.js} +5 -5
  18. package/dist/client/{PopUp-Cy2yuwTa.js → PopUp-B62ZJOjC.js} +3 -3
  19. package/dist/client/{VImg-CBdK-aqy.js → VImg-QLk7OX01.js} +2 -2
  20. package/dist/client/{VMain-DS_lMGEB.js → VMain-B-MLcE-i.js} +1 -1
  21. package/dist/client/{VOverlay-Dr3Qyf3n.js → VOverlay-BvYPb1bZ.js} +3 -3
  22. package/dist/client/{WidgetsContainer-C8M-2vnt.js → WidgetsContainer-DrniIeya.js} +1 -1
  23. package/dist/client/{asWebComponent-BNtA1Amp.js → asWebComponent-DMuA5f9s.js} +42 -23
  24. package/dist/client/eo-dash.js +1 -1
  25. package/dist/client/{forwardRefs-CPEcWmMd.js → forwardRefs-D3tZz55-.js} +1 -1
  26. package/dist/client/{index-CT6bsa-4.js → index-DsMetMaJ.js} +1 -1
  27. package/dist/client/{transition-B7l2l8dM.js → transition-BLWVvxR6.js} +1 -1
  28. package/dist/node/cli.js +1 -1
  29. package/dist/types/core/client/types.d.ts +2 -2
  30. package/dist/types/core/client/utils/createLayers.d.ts +3 -2
  31. package/dist/types/core/client/utils/helpers.d.ts +5 -1
  32. package/package.json +3 -2
  33. package/widgets/EodashLayerControl.vue +2 -1
@@ -10,8 +10,8 @@ import { currentUrl } from "./store/States";
10
10
  export const eodash = reactive({
11
11
  id: "demo",
12
12
  stacEndpoint:
13
- // "https://eodashcatalog.eox.at/test-style/trilateral/catalog.json",
14
- "https://gtif-cerulean.github.io/catalog/cerulean/catalog.json",
13
+ "https://eodashcatalog.eox.at/test-style/trilateral/catalog.json",
14
+ // "https://gtif-cerulean.github.io/catalog/cerulean/catalog.json",
15
15
  brand: {
16
16
  noLayout: true,
17
17
  name: "Demo",
@@ -46,7 +46,6 @@ export const useSTAcStore = defineStore("stac", () => {
46
46
  /**
47
47
  * Fetches root stac catalog and assign it to `stac`
48
48
  *
49
- * @async
50
49
  * @param {import("@/types").StacEndpoint} [url=eodash.stacEndpoint] Default
51
50
  * is `eodash.stacEndpoint`
52
51
  * @returns {Promise<void>}
@@ -76,7 +75,6 @@ export const useSTAcStore = defineStore("stac", () => {
76
75
  /**
77
76
  * Fetches selected stac object and assign it to `selectedStac`
78
77
  *
79
- * @async
80
78
  * @param {string} relativePath - Stac link href
81
79
  * @returns {Promise<void>}
82
80
  * @see {@link selectedStac}
@@ -117,7 +115,6 @@ export const useSTAcStore = defineStore("stac", () => {
117
115
  /**
118
116
  * Fetches selected stac object and assign it to `selectedCompareStac`
119
117
  *
120
- * @async
121
118
  * @param {string} relativePath - Stac link href
122
119
  * @returns {Promise<void>}
123
120
  * @see {@link selectedCompareStac}
@@ -258,7 +258,7 @@ export interface EodashStore {
258
258
  getLayers: (el?: string) => object[];
259
259
 
260
260
  /**
261
- * Register EPSG projection in `eox-map` and adds it to {@link EodashStore.states.availableMapProjection `availableMapProjection`` }
261
+ * Register EPSG projection in `eox-map` and adds it to `availableMapProjection`
262
262
  * */
263
263
  registerProjection: (
264
264
  code?: number | string | { name: string; def: string },
@@ -276,4 +276,4 @@ export interface EodashStore {
276
276
  };
277
277
  }
278
278
  ///////
279
- export * from "./main"
279
+ export { createEodash, store } from "./main.js";
@@ -16,6 +16,7 @@ import log from "loglevel";
16
16
  * @param {import("ol/layer/WebGLTile").Style} [style]
17
17
  * @param {Record<string, unknown>} [layerConfig]
18
18
  * @param {Record<string, unknown>} [layerDatetime]
19
+ * @param {object | null} [extraProperties]
19
20
  **/
20
21
  export async function createLayersFromAssets(
21
22
  collectionId,
@@ -25,6 +26,7 @@ export async function createLayersFromAssets(
25
26
  style,
26
27
  layerConfig,
27
28
  layerDatetime,
29
+ extraProperties,
28
30
  ) {
29
31
  log.debug("Creating layers from assets");
30
32
  let jsonArray = [];
@@ -64,6 +66,9 @@ export async function createLayersFromAssets(
64
66
  ...(!style?.variables && { style }),
65
67
  };
66
68
  extractRoles(layer.properties, assets[ast]);
69
+ if (extraProperties !== null) {
70
+ layer.properties = { ...layer.properties, ...extraProperties };
71
+ }
67
72
  jsonArray.push(layer);
68
73
  } else if (assets[ast]?.type === "image/tiff") {
69
74
  geoTIFFIdx = idx;
@@ -102,14 +107,14 @@ export async function createLayersFromAssets(
102
107
  * @param {import('stac-ts').StacItem} item
103
108
  * @param {string} title
104
109
  * @param {Record<string,any>} [layerDatetime]
105
- * @param {string | null} [legendInfo]
110
+ * @param {object | null} [extraProperties]
106
111
  */
107
112
  export const createLayersFromLinks = async (
108
113
  collectionId,
109
114
  title,
110
115
  item,
111
116
  layerDatetime,
112
- legendInfo,
117
+ extraProperties,
113
118
  ) => {
114
119
  log.debug("Creating layers from links");
115
120
  /** @type {Record<string,any>[]} */
@@ -167,9 +172,8 @@ export const createLayersFromLinks = async (
167
172
  // Expand all dimensions into the params attribute
168
173
  Object.assign(json.source.params, wmsLink["wms:dimensions"]);
169
174
  }
170
- if (legendInfo !== null) {
171
- // @ts-expect-error once we have a eox-map config type we can remove this
172
- json.properties.description = legendInfo;
175
+ if (extraProperties !== null) {
176
+ json.properties = { ...json.properties, ...extraProperties };
173
177
  }
174
178
  jsonArray.push(json);
175
179
  }
@@ -253,6 +257,9 @@ export const createLayersFromLinks = async (
253
257
  };
254
258
  }
255
259
  extractRoles(json.properties, wmtsLink);
260
+ if (extraProperties !== null) {
261
+ json.properties = { ...json.properties, ...extraProperties };
262
+ }
256
263
  jsonArray.push(json);
257
264
  }
258
265
 
@@ -286,6 +293,9 @@ export const createLayersFromLinks = async (
286
293
  };
287
294
 
288
295
  extractRoles(json.properties, xyzLink);
296
+ if (extraProperties !== null) {
297
+ json.properties = { ...json.properties, ...extraProperties };
298
+ }
289
299
  jsonArray.push(json);
290
300
  }
291
301
  return jsonArray;
@@ -167,7 +167,7 @@ export class EodashCollection {
167
167
  // will try to extract anything it supports but for which we have
168
168
  // less control.
169
169
 
170
- const { layerConfig, style } = extractLayerConfig(
170
+ let { layerConfig, style } = extractLayerConfig(
171
171
  await fetchStyle(item, itemUrl),
172
172
  );
173
173
 
@@ -188,19 +188,26 @@ export class EodashCollection {
188
188
 
189
189
  if (isSupported) {
190
190
  // Checking for potential legend asset
191
- let legendInfo = null;
191
+ let extraProperties = null;
192
192
  if (this.#collectionStac?.assets?.legend?.href) {
193
- legendInfo = `
194
- <div style="text-align:center; width: 100%">
193
+ extraProperties = {
194
+ description: `<div style="text-align:center; width: 100%">
195
195
  <img src="${this.#collectionStac.assets.legend.href}" style="max-height:70px; margin-top:-15px; margin-bottom:-20px;" />
196
- </div>`;
196
+ </div>`,
197
+ };
198
+ }
199
+ // Check if collection has eox:colorlegend definition, if yes overwrite legend description
200
+ if (this.#collectionStac && this.#collectionStac["eox:colorlegend"]) {
201
+ extraProperties = {
202
+ layerLegend: this.#collectionStac["eox:colorlegend"],
203
+ };
197
204
  }
198
205
  const links = await createLayersFromLinks(
199
206
  this.#collectionStac?.id ?? "",
200
207
  title,
201
208
  item,
202
209
  layerDatetime,
203
- legendInfo,
210
+ extraProperties,
204
211
  );
205
212
  jsonArray.push(
206
213
  ...links,
@@ -212,6 +219,7 @@ export class EodashCollection {
212
219
  style,
213
220
  layerConfig,
214
221
  layerDatetime,
222
+ extraProperties,
215
223
  )),
216
224
  );
217
225
  } else {
@@ -43,7 +43,7 @@ export function generateFeatures(links) {
43
43
  return geojsonObject;
44
44
  }
45
45
 
46
- /** @param { import("ol/layer/WebGLTile").Style & { jsonform?: Record<string,any> } } [style] */
46
+ /** @param { import("ol/layer/WebGLTile").Style & { jsonform?: Record<string,any> } & { legend?: Record<string,any> } } [style] */
47
47
  export function extractLayerConfig(style) {
48
48
  /** @type {Record<string,unknown> | undefined} */
49
49
  let layerConfig = undefined;
@@ -51,6 +51,10 @@ export function extractLayerConfig(style) {
51
51
  layerConfig = { schema: style.jsonform, type: "style" };
52
52
  style = { ...style };
53
53
  delete style.jsonform;
54
+ if (style?.legend) {
55
+ layerConfig.legend = style.legend;
56
+ delete style.legend;
57
+ }
54
58
  }
55
59
  log.debug(
56
60
  "extracted layerConfig",
@@ -1,7 +1,7 @@
1
1
  import { inject, openBlock, createBlock, withCtx, createElementVNode, unref, createElementBlock, Suspense, resolveDynamicComponent, mergeProps, createCommentVNode, Fragment, renderList, Transition } from 'vue';
2
- import { _ as _export_sfc, F as eodashKey, G as useDefineWidgets } from './asWebComponent-BNtA1Amp.js';
2
+ import { _ as _export_sfc, F as eodashKey, G as useDefineWidgets } from './asWebComponent-DMuA5f9s.js';
3
3
  import '@eox/layout';
4
- import { V as VMain } from './VMain-DS_lMGEB.js';
4
+ import { V as VMain } from './VMain-B-MLcE-i.js';
5
5
 
6
6
  const _hoisted_1 = ["gap"];
7
7
  const _hoisted_2 = {
@@ -1,5 +1,5 @@
1
1
  import { withAsyncContext, ref, onMounted, onUnmounted, openBlock, createElementBlock, createBlock, resolveDynamicComponent, mergeProps } from 'vue';
2
- import { $ as useSTAcStore } from './asWebComponent-BNtA1Amp.js';
2
+ import { $ as useSTAcStore } from './asWebComponent-DMuA5f9s.js';
3
3
 
4
4
  const _hoisted_1 = { class: "d-flex flex-column fill-height overflow-auto" };
5
5
 
@@ -1,11 +1,11 @@
1
1
  import { computed, ref, mergeProps, createVNode, resolveComponent, render, h, useCssVars, customRef, reactive, watch, onMounted, openBlock, createElementBlock, Fragment, unref, createSlots, withCtx, createElementVNode, toHandlers, withDirectives, createBlock } from 'vue';
2
2
  import { DatePicker } from 'v-calendar';
3
3
  import { storeToRefs } from 'pinia';
4
- import { p as propsFactory, o as omit, g as genericComponent, j as useProxiedModel, Y as getUid, a as useRender, E as isObject, Z as datetime, $ as useSTAcStore, a0 as eodashCollections, a1 as VRow, V as VBtn, y as VIcon } from './asWebComponent-BNtA1Amp.js';
4
+ import { p as propsFactory, o as omit, g as genericComponent, j as useProxiedModel, Y as getUid, a as useRender, E as isObject, Z as datetime, $ as useSTAcStore, a0 as eodashCollections, a1 as VRow, V as VBtn, y as VIcon } from './asWebComponent-DMuA5f9s.js';
5
5
  import { mdiRayEndArrow, mdiRayStartArrow } from '@mdi/js';
6
6
  import log from 'loglevel';
7
- import { m as makeVOverlayProps, V as VOverlay } from './VOverlay-Dr3Qyf3n.js';
8
- import { b as useScopeId, f as forwardRefs } from './forwardRefs-CPEcWmMd.js';
7
+ import { m as makeVOverlayProps, V as VOverlay } from './VOverlay-BvYPb1bZ.js';
8
+ import { b as useScopeId, f as forwardRefs } from './forwardRefs-D3tZz55-.js';
9
9
 
10
10
  const makeVTooltipProps = propsFactory({
11
11
  id: String,
@@ -1,5 +1,5 @@
1
1
  import { ref, onMounted, openBlock, createElementBlock, mergeProps, createElementVNode, toDisplayString } from 'vue';
2
- import { $ as useSTAcStore } from './asWebComponent-BNtA1Amp.js';
2
+ import { $ as useSTAcStore } from './asWebComponent-DMuA5f9s.js';
3
3
  import '@eox/itemfilter';
4
4
 
5
5
  const _hoisted_1 = {
@@ -2,7 +2,8 @@ import { computed, ref, openBlock, createElementBlock, unref, createCommentVNode
2
2
  import '@eox/layercontrol';
3
3
  import '@eox/jsonform';
4
4
  import '@eox/timecontrol';
5
- import { $ as useSTAcStore, a2 as mapCompareEl, a3 as mapEl, a4 as eodashCompareCollections, a0 as eodashCollections, a5 as getColFromLayer } from './asWebComponent-BNtA1Amp.js';
5
+ import 'color-legend-element';
6
+ import { $ as useSTAcStore, a2 as mapCompareEl, a3 as mapEl, a4 as eodashCompareCollections, a0 as eodashCollections, a5 as getColFromLayer } from './asWebComponent-DMuA5f9s.js';
6
7
  import { storeToRefs } from 'pinia';
7
8
 
8
9
  const _hoisted_1 = { class: "d-flex flex-column fill-height overflow-auto" };
@@ -94,7 +95,7 @@ return (_ctx, _cache) => {
94
95
  ? (openBlock(), createElementBlock("eox-layercontrol", {
95
96
  key: 0,
96
97
  for: unref(mapElement),
97
- ".tools": ['datetime', 'info', 'config', 'opacity'],
98
+ ".tools": ['datetime', 'info', 'config', 'legend', 'opacity'],
98
99
  "onDatetime:updated": debouncedHandleDateTime,
99
100
  class: "fill-height",
100
101
  toolsAsList: "true",
@@ -1,7 +1,7 @@
1
1
  import { onMounted, onUnmounted, watch, ref, computed, openBlock, createElementBlock, createElementVNode } from 'vue';
2
2
  import '@eox/map';
3
3
  import '@eox/map/dist/eox-map-advanced-layers-and-sources.js';
4
- import { $ as useSTAcStore, a6 as setMapProjFromCol, a7 as EodashCollection, a8 as mapPosition, a3 as mapEl, a2 as mapCompareEl, Z as datetime, a4 as eodashCompareCollections, a0 as eodashCollections } from './asWebComponent-BNtA1Amp.js';
4
+ import { $ as useSTAcStore, a6 as setMapProjFromCol, a7 as EodashCollection, a8 as mapPosition, a3 as mapEl, a2 as mapCompareEl, Z as datetime, a4 as eodashCompareCollections, a0 as eodashCollections } from './asWebComponent-DMuA5f9s.js';
5
5
  import { storeToRefs } from 'pinia';
6
6
  import log from 'loglevel';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { ref, openBlock, createElementBlock, createBlock, unref, createCommentVNode } from 'vue';
2
- import { _ as _export_sfc, a9 as makePanelTransparent, V as VBtn, aa as availableMapProjection, ab as changeMapProjection } from './asWebComponent-BNtA1Amp.js';
2
+ import { _ as _export_sfc, a9 as makePanelTransparent, V as VBtn, aa as availableMapProjection, ab as changeMapProjection } from './asWebComponent-DMuA5f9s.js';
3
3
  import { mdiMapPlus, mdiEarthBox } from '@mdi/js';
4
- import ExportState from './ExportState-Cs26sTpI.js';
4
+ import ExportState from './ExportState-CzxCA7c4.js';
5
5
 
6
6
  const _sfc_main = {
7
7
  __name: 'EodashMapBtns',
@@ -1,9 +1,9 @@
1
1
  import { createVNode, Fragment, computed, withDirectives, mergeProps, resolveDirective, toRef, mergeModels, useModel, ref, openBlock, createBlock, withCtx, createElementVNode, createTextVNode, toDisplayString, unref, createElementBlock, createCommentVNode, renderList } from 'vue';
2
2
  import { mdiClipboardCheckOutline, mdiContentCopy } from '@mdi/js';
3
- import _sfc_main$1 from './PopUp-Cy2yuwTa.js';
4
- import { ac as createSimpleFunctional, g as genericComponent, b as makeComponentProps, D as provideDefaults, a as useRender, p as propsFactory, c as makeTagProps, I as IconValue, L as makeBorderProps, A as makeDensityProps, N as makeRoundedProps, ad as makeSizeProps, d as makeThemeProps, ae as makeVariantProps, e as provideTheme, O as useBorder, af as useVariant, B as useDensity, Q as useRounded, ag as useSize, y as VIcon, R as VDefaultsProvider, ah as genOverlays, J as makeDimensionProps, M as makeElevationProps, ai as makeLoaderProps, aj as makeLocationProps, ak as makePositionProps, al as makeRouterProps, am as Ripple, K as useDimension, P as useElevation, an as useLoader, ao as useLocation, ap as usePosition, aq as useLink, ar as LoaderSlot, u as useTextColor, q as convertToUnit, _ as _export_sfc, as as getLayers, a8 as mapPosition, at as removeUnneededProperties, a1 as VRow, au as VCol, V as VBtn, av as copyToClipBoard } from './asWebComponent-BNtA1Amp.js';
5
- import { a as VExpandTransition } from './index-CT6bsa-4.js';
6
- import { V as VImg } from './VImg-CBdK-aqy.js';
3
+ import _sfc_main$1 from './PopUp-B62ZJOjC.js';
4
+ import { ac as createSimpleFunctional, g as genericComponent, b as makeComponentProps, D as provideDefaults, a as useRender, p as propsFactory, c as makeTagProps, I as IconValue, L as makeBorderProps, A as makeDensityProps, N as makeRoundedProps, ad as makeSizeProps, d as makeThemeProps, ae as makeVariantProps, e as provideTheme, O as useBorder, af as useVariant, B as useDensity, Q as useRounded, ag as useSize, y as VIcon, R as VDefaultsProvider, ah as genOverlays, J as makeDimensionProps, M as makeElevationProps, ai as makeLoaderProps, aj as makeLocationProps, ak as makePositionProps, al as makeRouterProps, am as Ripple, K as useDimension, P as useElevation, an as useLoader, ao as useLocation, ap as usePosition, aq as useLink, ar as LoaderSlot, u as useTextColor, q as convertToUnit, _ as _export_sfc, as as getLayers, a8 as mapPosition, at as removeUnneededProperties, a1 as VRow, au as VCol, V as VBtn, av as copyToClipBoard } from './asWebComponent-DMuA5f9s.js';
5
+ import { a as VExpandTransition } from './index-DsMetMaJ.js';
6
+ import { V as VImg } from './VImg-QLk7OX01.js';
7
7
 
8
8
  // Styles
9
9
  const VSpacer = createSimpleFunctional('v-spacer', 'div', 'VSpacer');
@@ -1,5 +1,5 @@
1
1
  import { ref, toRef, shallowRef, computed, createVNode, watchEffect, inject, openBlock, createBlock, unref, withCtx, createElementVNode, toDisplayString, createTextVNode } from 'vue';
2
- import { p as propsFactory, L as makeBorderProps, b as makeComponentProps, M as makeElevationProps, U as makeLayoutItemProps, N as makeRoundedProps, c as makeTagProps, d as makeThemeProps, g as genericComponent, e as provideTheme, C as useBackgroundColor, O as useBorder, P as useElevation, Q as useRounded, v as useResizeObserver, W as useToggleScope, a as useRender, q as convertToUnit, X as useLayoutItem, _ as _export_sfc, F as eodashKey, t as useDisplay } from './asWebComponent-BNtA1Amp.js';
2
+ import { p as propsFactory, L as makeBorderProps, b as makeComponentProps, M as makeElevationProps, U as makeLayoutItemProps, N as makeRoundedProps, c as makeTagProps, d as makeThemeProps, g as genericComponent, e as provideTheme, C as useBackgroundColor, O as useBorder, P as useElevation, Q as useRounded, v as useResizeObserver, W as useToggleScope, a as useRender, q as convertToUnit, X as useLayoutItem, _ as _export_sfc, F as eodashKey, t as useDisplay } from './asWebComponent-DMuA5f9s.js';
3
3
 
4
4
  const makeVFooterProps = propsFactory({
5
5
  app: Boolean,
@@ -1,7 +1,7 @@
1
1
  import { createVNode, toRef, shallowRef, computed, ref, watch, onMounted, onBeforeUnmount, mergeProps, watchEffect, inject, openBlock, createBlock, withCtx, createTextVNode, toDisplayString, unref } from 'vue';
2
- import { p as propsFactory, b as makeComponentProps, c as makeTagProps, g as genericComponent, a as useRender, L as makeBorderProps, M as makeElevationProps, N as makeRoundedProps, d as makeThemeProps, C as useBackgroundColor, O as useBorder, P as useElevation, Q as useRounded, e as provideTheme, f as useRtl, D as provideDefaults, R as VDefaultsProvider, q as convertToUnit, S as clamp, T as consoleWarn, U as makeLayoutItemProps, j as useProxiedModel, W as useToggleScope, X as useLayoutItem, _ as _export_sfc, F as eodashKey } from './asWebComponent-BNtA1Amp.js';
3
- import { a as VExpandTransition } from './index-CT6bsa-4.js';
4
- import { V as VImg } from './VImg-CBdK-aqy.js';
2
+ import { p as propsFactory, b as makeComponentProps, c as makeTagProps, g as genericComponent, a as useRender, L as makeBorderProps, M as makeElevationProps, N as makeRoundedProps, d as makeThemeProps, C as useBackgroundColor, O as useBorder, P as useElevation, Q as useRounded, e as provideTheme, f as useRtl, D as provideDefaults, R as VDefaultsProvider, q as convertToUnit, S as clamp, T as consoleWarn, U as makeLayoutItemProps, j as useProxiedModel, W as useToggleScope, X as useLayoutItem, _ as _export_sfc, F as eodashKey } from './asWebComponent-DMuA5f9s.js';
3
+ import { a as VExpandTransition } from './index-DsMetMaJ.js';
4
+ import { V as VImg } from './VImg-QLk7OX01.js';
5
5
  import { u as useSsrBoot } from './ssrBoot-BP7SYRyC.js';
6
6
 
7
7
  const makeVToolbarTitleProps = propsFactory({
@@ -1,10 +1,10 @@
1
1
  import { ref, computed, createVNode, mergeProps, Fragment, shallowRef, watch, provide, withDirectives, resolveDirective, inject, vShow, nextTick, toRef, useCssVars, onMounted, openBlock, createBlock, withCtx, Suspense, unref, resolveDynamicComponent, createCommentVNode, createElementBlock, renderList, createTextVNode, createElementVNode, toDisplayString } from 'vue';
2
- import { k as keys, p as propsFactory, o as omit, m as makeVBtnProps, g as genericComponent, u as useTextColor, a as useRender, V as VBtn, b as makeComponentProps, c as makeTagProps, d as makeThemeProps, e as provideTheme, f as useRtl, h as useLocale, i as useGroup, j as useProxiedModel, l as makeGroupItemProps, n as useGroupItem, q as convertToUnit, I as IconValue, r as makeDisplayProps, s as makeGroupProps, t as useDisplay, v as useResizeObserver, w as useGoTo, x as IN_BROWSER, y as VIcon, z as focusableChildren, A as makeDensityProps, B as useDensity, C as useBackgroundColor, D as provideDefaults, E as isObject, _ as _export_sfc, F as eodashKey, G as useDefineWidgets, H as useLayout } from './asWebComponent-BNtA1Amp.js';
3
- import { V as VMain } from './VMain-DS_lMGEB.js';
4
- import { f as forwardRefs, a as animate, s as standardEasing, m as makeLazyProps, u as useLazy, b as useScopeId } from './forwardRefs-CPEcWmMd.js';
2
+ import { k as keys, p as propsFactory, o as omit, m as makeVBtnProps, g as genericComponent, u as useTextColor, a as useRender, V as VBtn, b as makeComponentProps, c as makeTagProps, d as makeThemeProps, e as provideTheme, f as useRtl, h as useLocale, i as useGroup, j as useProxiedModel, l as makeGroupItemProps, n as useGroupItem, q as convertToUnit, I as IconValue, r as makeDisplayProps, s as makeGroupProps, t as useDisplay, v as useResizeObserver, w as useGoTo, x as IN_BROWSER, y as VIcon, z as focusableChildren, A as makeDensityProps, B as useDensity, C as useBackgroundColor, D as provideDefaults, E as isObject, _ as _export_sfc, F as eodashKey, G as useDefineWidgets, H as useLayout } from './asWebComponent-DMuA5f9s.js';
3
+ import { V as VMain } from './VMain-B-MLcE-i.js';
4
+ import { f as forwardRefs, a as animate, s as standardEasing, m as makeLazyProps, u as useLazy, b as useScopeId } from './forwardRefs-D3tZz55-.js';
5
5
  import { u as useSsrBoot } from './ssrBoot-BP7SYRyC.js';
6
- import { M as MaybeTransition } from './transition-B7l2l8dM.js';
7
- import { V as VFadeTransition } from './index-CT6bsa-4.js';
6
+ import { M as MaybeTransition } from './transition-BLWVvxR6.js';
7
+ import { V as VFadeTransition } from './index-DsMetMaJ.js';
8
8
 
9
9
  // Utilities
10
10
  const handleGesture = wrapper => {
@@ -1,7 +1,7 @@
1
1
  import { createVNode, Transition, mergeProps, ref, watch, nextTick, toRef, mergeModels, useModel, openBlock, createElementBlock, withCtx, createBlock, resolveDynamicComponent, unref, createCommentVNode, renderSlot } from 'vue';
2
- import { g as genericComponent, p as propsFactory, j as useProxiedModel, x as IN_BROWSER, a as useRender, z as focusableChildren, R as VDefaultsProvider, L as makeBorderProps, b as makeComponentProps, J as makeDimensionProps, M as makeElevationProps, aj as makeLocationProps, ak as makePositionProps, N as makeRoundedProps, c as makeTagProps, d as makeThemeProps, e as provideTheme, C as useBackgroundColor, O as useBorder, K as useDimension, P as useElevation, ao as useLocation, ap as usePosition, Q as useRounded, G as useDefineWidgets } from './asWebComponent-BNtA1Amp.js';
3
- import { m as makeVOverlayProps, V as VOverlay } from './VOverlay-Dr3Qyf3n.js';
4
- import { a as animate, d as deceleratedEasing, s as standardEasing, c as acceleratedEasing, g as getTargetBox, n as nullifyTransforms, b as useScopeId, f as forwardRefs } from './forwardRefs-CPEcWmMd.js';
2
+ import { g as genericComponent, p as propsFactory, j as useProxiedModel, x as IN_BROWSER, a as useRender, z as focusableChildren, R as VDefaultsProvider, L as makeBorderProps, b as makeComponentProps, J as makeDimensionProps, M as makeElevationProps, aj as makeLocationProps, ak as makePositionProps, N as makeRoundedProps, c as makeTagProps, d as makeThemeProps, e as provideTheme, C as useBackgroundColor, O as useBorder, K as useDimension, P as useElevation, ao as useLocation, ap as usePosition, Q as useRounded, G as useDefineWidgets } from './asWebComponent-DMuA5f9s.js';
3
+ import { m as makeVOverlayProps, V as VOverlay } from './VOverlay-BvYPb1bZ.js';
4
+ import { a as animate, d as deceleratedEasing, s as standardEasing, c as acceleratedEasing, g as getTargetBox, n as nullifyTransforms, b as useScopeId, f as forwardRefs } from './forwardRefs-D3tZz55-.js';
5
5
 
6
6
  const makeVDialogTransitionProps = propsFactory({
7
7
  target: [Object, Array]
@@ -1,6 +1,6 @@
1
1
  import { createVNode, computed, toRef, shallowRef, ref, watch, onBeforeMount, nextTick, onBeforeUnmount, withDirectives, mergeProps, Fragment, resolveDirective, vShow } from 'vue';
2
- import { aw as SUPPORTS_INTERSECTION, p as propsFactory, b as makeComponentProps, J as makeDimensionProps, g as genericComponent, K as useDimension, a as useRender, N as makeRoundedProps, C as useBackgroundColor, Q as useRounded, ax as getCurrentInstance, q as convertToUnit } from './asWebComponent-BNtA1Amp.js';
3
- import { m as makeTransitionProps, M as MaybeTransition } from './transition-B7l2l8dM.js';
2
+ import { aw as SUPPORTS_INTERSECTION, p as propsFactory, b as makeComponentProps, J as makeDimensionProps, g as genericComponent, K as useDimension, a as useRender, N as makeRoundedProps, C as useBackgroundColor, Q as useRounded, ax as getCurrentInstance, q as convertToUnit } from './asWebComponent-DMuA5f9s.js';
3
+ import { m as makeTransitionProps, M as MaybeTransition } from './transition-BLWVvxR6.js';
4
4
 
5
5
  // Utilities
6
6
  function mounted(el, binding) {
@@ -1,5 +1,5 @@
1
1
  import { createVNode } from 'vue';
2
- import { p as propsFactory, b as makeComponentProps, J as makeDimensionProps, c as makeTagProps, g as genericComponent, K as useDimension, H as useLayout, a as useRender } from './asWebComponent-BNtA1Amp.js';
2
+ import { p as propsFactory, b as makeComponentProps, J as makeDimensionProps, c as makeTagProps, g as genericComponent, K as useDimension, H as useLayout, a as useRender } from './asWebComponent-DMuA5f9s.js';
3
3
  import { u as useSsrBoot } from './ssrBoot-BP7SYRyC.js';
4
4
 
5
5
  const makeVMainProps = propsFactory({
@@ -1,7 +1,7 @@
1
1
  import { ref, watch, onScopeDispose, computed, nextTick, watchEffect, effectScope, inject, mergeProps, shallowRef, onMounted, reactive, provide, readonly, toRaw, warn, toRef, onBeforeUnmount, createVNode, Fragment, Teleport, withDirectives, vShow, resolveDirective, Transition } from 'vue';
2
- import { ay as isOn, az as eventName, p as propsFactory, x as IN_BROWSER, W as useToggleScope, aA as destructComputed, aB as parseAnchor, aC as flipSide, aD as flipAlign, aE as flipCorner, aF as consoleError, aG as getAxis, q as convertToUnit, S as clamp, aH as defer, ax as getCurrentInstance, aI as templateRef, aJ as matchesSelector, t as useDisplay, b as makeComponentProps, J as makeDimensionProps, d as makeThemeProps, g as genericComponent, j as useProxiedModel, e as provideTheme, f as useRtl, C as useBackgroundColor, K as useDimension, aK as useRouter, a as useRender, aL as useBackButton } from './asWebComponent-BNtA1Amp.js';
3
- import { g as getTargetBox, B as Box, e as getOverflow, n as nullifyTransforms, m as makeLazyProps, u as useLazy, b as useScopeId, a as animate, s as standardEasing } from './forwardRefs-CPEcWmMd.js';
4
- import { m as makeTransitionProps, M as MaybeTransition } from './transition-B7l2l8dM.js';
2
+ import { ay as isOn, az as eventName, p as propsFactory, x as IN_BROWSER, W as useToggleScope, aA as destructComputed, aB as parseAnchor, aC as flipSide, aD as flipAlign, aE as flipCorner, aF as consoleError, aG as getAxis, q as convertToUnit, S as clamp, aH as defer, ax as getCurrentInstance, aI as templateRef, aJ as matchesSelector, t as useDisplay, b as makeComponentProps, J as makeDimensionProps, d as makeThemeProps, g as genericComponent, j as useProxiedModel, e as provideTheme, f as useRtl, C as useBackgroundColor, K as useDimension, aK as useRouter, a as useRender, aL as useBackButton } from './asWebComponent-DMuA5f9s.js';
3
+ import { g as getTargetBox, B as Box, e as getOverflow, n as nullifyTransforms, m as makeLazyProps, u as useLazy, b as useScopeId, a as animate, s as standardEasing } from './forwardRefs-D3tZz55-.js';
4
+ import { m as makeTransitionProps, M as MaybeTransition } from './transition-BLWVvxR6.js';
5
5
 
6
6
  // Utilities
7
7
  const handlers = new WeakMap();
@@ -1,5 +1,5 @@
1
1
  import { ref, onMounted, nextTick, openBlock, createElementBlock, Fragment, renderList, unref, createElementVNode, toDisplayString, normalizeStyle, createBlock, resolveDynamicComponent, mergeProps } from 'vue';
2
- import { G as useDefineWidgets, H as useLayout } from './asWebComponent-BNtA1Amp.js';
2
+ import { G as useDefineWidgets, H as useLayout } from './asWebComponent-DMuA5f9s.js';
3
3
  import 'animated-details';
4
4
 
5
5
  const _sfc_main = {
@@ -3830,7 +3830,7 @@ function generateFeatures(links) {
3830
3830
  return geojsonObject;
3831
3831
  }
3832
3832
 
3833
- /** @param { import("ol/layer/WebGLTile").Style & { jsonform?: Record<string,any> } } [style] */
3833
+ /** @param { import("ol/layer/WebGLTile").Style & { jsonform?: Record<string,any> } & { legend?: Record<string,any> } } [style] */
3834
3834
  function extractLayerConfig(style) {
3835
3835
  /** @type {Record<string,unknown> | undefined} */
3836
3836
  let layerConfig = undefined;
@@ -3838,6 +3838,10 @@ function extractLayerConfig(style) {
3838
3838
  layerConfig = { schema: style.jsonform, type: "style" };
3839
3839
  style = { ...style };
3840
3840
  delete style.jsonform;
3841
+ if (style?.legend) {
3842
+ layerConfig.legend = style.legend;
3843
+ delete style.legend;
3844
+ }
3841
3845
  }
3842
3846
  log.debug(
3843
3847
  "extracted layerConfig",
@@ -4236,8 +4240,8 @@ const __vite_glob_0_0 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.definePro
4236
4240
  const eodash = reactive({
4237
4241
  id: "demo",
4238
4242
  stacEndpoint:
4239
- // "https://eodashcatalog.eox.at/test-style/trilateral/catalog.json",
4240
- "https://gtif-cerulean.github.io/catalog/cerulean/catalog.json",
4243
+ "https://eodashcatalog.eox.at/test-style/trilateral/catalog.json",
4244
+ // "https://gtif-cerulean.github.io/catalog/cerulean/catalog.json",
4241
4245
  brand: {
4242
4246
  noLayout: true,
4243
4247
  name: "Demo",
@@ -7943,6 +7947,7 @@ const eodashCompareCollections = shallowReactive([]);
7943
7947
  * @param {import("ol/layer/WebGLTile").Style} [style]
7944
7948
  * @param {Record<string, unknown>} [layerConfig]
7945
7949
  * @param {Record<string, unknown>} [layerDatetime]
7950
+ * @param {object | null} [extraProperties]
7946
7951
  **/
7947
7952
  async function createLayersFromAssets(
7948
7953
  collectionId,
@@ -7952,6 +7957,7 @@ async function createLayersFromAssets(
7952
7957
  style,
7953
7958
  layerConfig,
7954
7959
  layerDatetime,
7960
+ extraProperties,
7955
7961
  ) {
7956
7962
  log.debug("Creating layers from assets");
7957
7963
  let jsonArray = [];
@@ -7991,6 +7997,9 @@ async function createLayersFromAssets(
7991
7997
  ...(!style?.variables && { style }),
7992
7998
  };
7993
7999
  extractRoles(layer.properties, assets[ast]);
8000
+ if (extraProperties !== null) {
8001
+ layer.properties = { ...layer.properties, ...extraProperties };
8002
+ }
7994
8003
  jsonArray.push(layer);
7995
8004
  } else if (assets[ast]?.type === "image/tiff") {
7996
8005
  geoTIFFIdx = idx;
@@ -8029,14 +8038,14 @@ async function createLayersFromAssets(
8029
8038
  * @param {import('stac-ts').StacItem} item
8030
8039
  * @param {string} title
8031
8040
  * @param {Record<string,any>} [layerDatetime]
8032
- * @param {string | null} [legendInfo]
8041
+ * @param {object | null} [extraProperties]
8033
8042
  */
8034
8043
  const createLayersFromLinks = async (
8035
8044
  collectionId,
8036
8045
  title,
8037
8046
  item,
8038
8047
  layerDatetime,
8039
- legendInfo,
8048
+ extraProperties,
8040
8049
  ) => {
8041
8050
  log.debug("Creating layers from links");
8042
8051
  /** @type {Record<string,any>[]} */
@@ -8094,9 +8103,8 @@ const createLayersFromLinks = async (
8094
8103
  // Expand all dimensions into the params attribute
8095
8104
  Object.assign(json.source.params, wmsLink["wms:dimensions"]);
8096
8105
  }
8097
- if (legendInfo !== null) {
8098
- // @ts-expect-error once we have a eox-map config type we can remove this
8099
- json.properties.description = legendInfo;
8106
+ if (extraProperties !== null) {
8107
+ json.properties = { ...json.properties, ...extraProperties };
8100
8108
  }
8101
8109
  jsonArray.push(json);
8102
8110
  }
@@ -8180,6 +8188,9 @@ const createLayersFromLinks = async (
8180
8188
  };
8181
8189
  }
8182
8190
  extractRoles(json.properties, wmtsLink);
8191
+ if (extraProperties !== null) {
8192
+ json.properties = { ...json.properties, ...extraProperties };
8193
+ }
8183
8194
  jsonArray.push(json);
8184
8195
  }
8185
8196
 
@@ -8213,6 +8224,9 @@ const createLayersFromLinks = async (
8213
8224
  };
8214
8225
 
8215
8226
  extractRoles(json.properties, xyzLink);
8227
+ if (extraProperties !== null) {
8228
+ json.properties = { ...json.properties, ...extraProperties };
8229
+ }
8216
8230
  jsonArray.push(json);
8217
8231
  }
8218
8232
  return jsonArray;
@@ -8367,7 +8381,7 @@ class EodashCollection {
8367
8381
  // will try to extract anything it supports but for which we have
8368
8382
  // less control.
8369
8383
 
8370
- const { layerConfig, style } = extractLayerConfig(
8384
+ let { layerConfig, style } = extractLayerConfig(
8371
8385
  await fetchStyle(item, itemUrl),
8372
8386
  );
8373
8387
 
@@ -8388,19 +8402,26 @@ class EodashCollection {
8388
8402
 
8389
8403
  if (isSupported) {
8390
8404
  // Checking for potential legend asset
8391
- let legendInfo = null;
8405
+ let extraProperties = null;
8392
8406
  if (this.#collectionStac?.assets?.legend?.href) {
8393
- legendInfo = `
8394
- <div style="text-align:center; width: 100%">
8407
+ extraProperties = {
8408
+ description: `<div style="text-align:center; width: 100%">
8395
8409
  <img src="${this.#collectionStac.assets.legend.href}" style="max-height:70px; margin-top:-15px; margin-bottom:-20px;" />
8396
- </div>`;
8410
+ </div>`,
8411
+ };
8412
+ }
8413
+ // Check if collection has eox:colorlegend definition, if yes overwrite legend description
8414
+ if (this.#collectionStac && this.#collectionStac["eox:colorlegend"]) {
8415
+ extraProperties = {
8416
+ layerLegend: this.#collectionStac["eox:colorlegend"],
8417
+ };
8397
8418
  }
8398
8419
  const links = await createLayersFromLinks(
8399
8420
  this.#collectionStac?.id ?? "",
8400
8421
  title,
8401
8422
  item,
8402
8423
  layerDatetime,
8403
- legendInfo,
8424
+ extraProperties,
8404
8425
  );
8405
8426
  jsonArray.push(
8406
8427
  ...links,
@@ -8412,6 +8433,7 @@ class EodashCollection {
8412
8433
  style,
8413
8434
  layerConfig,
8414
8435
  layerDatetime,
8436
+ extraProperties,
8415
8437
  )),
8416
8438
  );
8417
8439
  } else {
@@ -8626,7 +8648,6 @@ const useSTAcStore = defineStore("stac", () => {
8626
8648
  /**
8627
8649
  * Fetches root stac catalog and assign it to `stac`
8628
8650
  *
8629
- * @async
8630
8651
  * @param {import("@/types").StacEndpoint} [url=eodash.stacEndpoint] Default
8631
8652
  * is `eodash.stacEndpoint`
8632
8653
  * @returns {Promise<void>}
@@ -8656,7 +8677,6 @@ const useSTAcStore = defineStore("stac", () => {
8656
8677
  /**
8657
8678
  * Fetches selected stac object and assign it to `selectedStac`
8658
8679
  *
8659
- * @async
8660
8680
  * @param {string} relativePath - Stac link href
8661
8681
  * @returns {Promise<void>}
8662
8682
  * @see {@link selectedStac}
@@ -8697,7 +8717,6 @@ const useSTAcStore = defineStore("stac", () => {
8697
8717
  /**
8698
8718
  * Fetches selected stac object and assign it to `selectedCompareStac`
8699
8719
  *
8700
- * @async
8701
8720
  * @param {string} relativePath - Stac link href
8702
8721
  * @returns {Promise<void>}
8703
8722
  * @see {@link selectedCompareStac}
@@ -8892,7 +8911,7 @@ const copyToClipBoard = async (text, showIcon) => {
8892
8911
  const internalWidgets = (() => {
8893
8912
  /** @type {Record<string, () => Promise<import("vue").Component>>} */
8894
8913
  const importMap = {
8895
- .../* #__PURE__ */ Object.assign({"/widgets/EodashDatePicker.vue": () => import('./EodashDatePicker-CYH67qUf.js'),"/widgets/EodashItemFilter.vue": () => import('./EodashItemFilter-BPtyEU15.js'),"/widgets/EodashLayerControl.vue": () => import('./EodashLayerControl-BMulJ7Nu.js'),"/widgets/EodashMap.vue": () => import('./EodashMap-CAlmeyEK.js'),"/widgets/EodashMapBtns.vue": () => import('./EodashMapBtns-Cb21hoLK.js'),"/widgets/ExportState.vue": () => import('./ExportState-Cs26sTpI.js'),"/widgets/PopUp.vue": () => import('./PopUp-Cy2yuwTa.js'),"/widgets/WidgetsContainer.vue": () => import('./WidgetsContainer-C8M-2vnt.js')}),
8914
+ .../* #__PURE__ */ Object.assign({"/widgets/EodashDatePicker.vue": () => import('./EodashDatePicker-I6KQaEyw.js'),"/widgets/EodashItemFilter.vue": () => import('./EodashItemFilter-CuX_el88.js'),"/widgets/EodashLayerControl.vue": () => import('./EodashLayerControl-QXaIbd4a.js'),"/widgets/EodashMap.vue": () => import('./EodashMap-PD1dCjMS.js'),"/widgets/EodashMapBtns.vue": () => import('./EodashMapBtns-DzguYarW.js'),"/widgets/ExportState.vue": () => import('./ExportState-CzxCA7c4.js'),"/widgets/PopUp.vue": () => import('./PopUp-B62ZJOjC.js'),"/widgets/WidgetsContainer.vue": () => import('./WidgetsContainer-DrniIeya.js')}),
8896
8915
  .../* #__PURE__ */ Object.assign({}),
8897
8916
  };
8898
8917
  for (const key in importMap) {
@@ -9001,7 +9020,7 @@ const getWidgetDefinition = (config) => {
9001
9020
 
9002
9021
  case "web-component":
9003
9022
  importedWidget.component = defineAsyncComponent({
9004
- loader: () => import('./DynamicWebComponent-B3pcDnnp.js'),
9023
+ loader: () => import('./DynamicWebComponent-BJ5-IY6R.js'),
9005
9024
  suspensible: true,
9006
9025
  });
9007
9026
  importedWidget.props = reactive(config.widget);
@@ -11352,14 +11371,14 @@ const { loadSTAC } = useSTAcStore();
11352
11371
 
11353
11372
  const { smAndDown } = useDisplay();
11354
11373
  const TemplateComponent = smAndDown.value
11355
- ? defineAsyncComponent(() => import('./MobileLayout-fwxBmlOE.js'))
11356
- : defineAsyncComponent(() => import('./DashboardLayout-BZDjLPAM.js'));
11374
+ ? defineAsyncComponent(() => import('./MobileLayout-9o2BIRae.js'))
11375
+ : defineAsyncComponent(() => import('./DashboardLayout-DXDjBC-p.js'));
11357
11376
 
11358
11377
  const HeaderComponent = defineAsyncComponent(
11359
- () => import('./Header-BCbNDZVc.js'),
11378
+ () => import('./Header-B0UJlW9C.js'),
11360
11379
  );
11361
11380
  const FooterComponent = defineAsyncComponent(
11362
- () => import('./Footer-DeQud94i.js'),
11381
+ () => import('./Footer-DEajGQxT.js'),
11363
11382
  );
11364
11383
 
11365
11384
  const templateHeight = props.isWebComponent ? "100%" : "100dvh";
@@ -1,2 +1,2 @@
1
- export { aM as Eodash, aN as register, aO as store } from './asWebComponent-BNtA1Amp.js';
1
+ export { aM as Eodash, aN as register, aO as store } from './asWebComponent-DMuA5f9s.js';
2
2
  import 'vue';
@@ -1,5 +1,5 @@
1
1
  import { shallowRef, computed, watch } from 'vue';
2
- import { p as propsFactory, ax as getCurrentInstance } from './asWebComponent-BNtA1Amp.js';
2
+ import { p as propsFactory, ax as getCurrentInstance } from './asWebComponent-DMuA5f9s.js';
3
3
 
4
4
  class Box {
5
5
  constructor(_ref) {
@@ -1,5 +1,5 @@
1
1
  import { TransitionGroup, Transition, h, camelize } from 'vue';
2
- import { g as genericComponent, p as propsFactory } from './asWebComponent-BNtA1Amp.js';
2
+ import { g as genericComponent, p as propsFactory } from './asWebComponent-DMuA5f9s.js';
3
3
 
4
4
  // Utilities
5
5
  const makeTransitionProps = propsFactory({
@@ -1,5 +1,5 @@
1
1
  import { h, mergeProps, TransitionGroup, Transition } from 'vue';
2
- import { p as propsFactory } from './asWebComponent-BNtA1Amp.js';
2
+ import { p as propsFactory } from './asWebComponent-DMuA5f9s.js';
3
3
 
4
4
  // Utilities
5
5
  const makeTransitionProps = propsFactory({
package/dist/node/cli.js CHANGED
@@ -17,4 +17,4 @@ ${o.lib?`<eo-dash style="height:100dvh;"/>
17
17
  <script type="module" src="${t.resolve(`/@fs/${c}`,"core/client/render.js")}"><\/script>
18
18
  `}
19
19
  </body>
20
- </html>`,x=w(async({mode:e,command:a})=>({base:o.base??"",cacheDir:Y,plugins:[H({template:{transformAssetUrls:J,compilerOptions:{isCustomElement:r=>!r.includes("v-")&&r.includes("-")}}}),M({autoImport:!0}),e==="development"&&{name:"inject-html",configureServer:G}],customLogger:g,define:{"process.env":{}},resolve:{alias:{"@":t.join(c,"core/client"),"^":t.join(c,"widgets"),"user:config":m,"user:widgets":D},extensions:[".js",".json",".jsx",".mjs",".ts",".tsx",".vue"]},server:{warmup:{clientFiles:[t.join(c,"core/client/**"),m]},port:o.port??3e3,open:o.open,fs:{allow:[W(process.cwd())]},host:o.host},root:c,...e==="development"&&{optimizeDeps:{include:["webfontloader","vuetify","vue","pinia","stac-js","urijs","loglevel"],noDiscovery:!0}},publicDir:o.publicDir===!1?!1:z,build:{outDir:v,emptyOutDir:!0,target:"esnext",cssMinify:!0,...o.lib&&a==="build"&&{minify:!1,lib:{entry:t.join(c,"core/client/asWebComponent.js"),fileName:"eo-dash",formats:["es"],name:"@eodash/eodash"},rollupOptions:{input:t.join(c,"core/client/asWebComponent.js"),external:r=>{const i=r.includes("vuetify")||r.endsWith(".css")||r.endsWith("styles"),n=V.some(l=>r.startsWith(l));return!i&&n}}}}})),k=w(async e=>o.vite?F(await x(e),o.vite):x(e));async function G(e){e.watcher.add([m,p,t.join(D,"**/*.vue")]);let a="";const r=g.info;return g.info=(i,n)=>{if(i.includes("core")){const l=i.split("/")[0].split(" ");l.pop();const d=l.join(" ")+" "+a.replace(s,"");return r(d,n)}return r(i,n)},e.watcher.on("change",async i=>{a=i,i===p&&e.ws.send({type:"full-reload",path:i})}),()=>{e.middlewares.use(async(i,n,l)=>{if(i.originalUrl==="/@fs/config.js"||i.originalUrl==="/config.js"){n.statusCode=200,n.setHeader("Content-Type","text/javascript"),u(p)&&await T(p).then(d=>{n.write(d)}),n.end();return}if(i.url?.endsWith(".html")){n.statusCode=200,n.setHeader("Content-Type","text/html");const d=await e.transformIndexHtml(i.url,C,i.originalUrl);n.end(d);return}l()})}}const K=async()=>{const e=await O(await k({mode:"development",command:"serve"}));await e.listen(),e.printUrls(),e.bindCLIShortcuts({print:!0})},Q=async()=>{const e=async()=>{const a=await k({mode:"production",command:"build"});await N(a),u(p)&&await A(p,t.join(v,"config.js"),{recursive:!0}).catch(r=>{console.error(r)})};if(o.lib)await e();else{const a=t.join(c,"/index.html");await $(a,C).then(async()=>{await e(),await L(a).catch(()=>{console.error("failed to remove index.html")})})}};async function X(){(await U({root:s,base:o.base??"",preview:{port:isNaN(o.port)?8080:o.port,open:o.open,host:o.host},build:{outDir:v}})).printUrls()}const Z=process.argv?.[2];(async()=>{switch(Z){case"dev":await K();break;case"build":await Q();break;case"preview":await X();break;default:console.error("command not found");break}})();
20
+ </html>`,x=w(async({mode:e,command:a})=>({base:o.base??"",cacheDir:Y,plugins:[H({template:{transformAssetUrls:J,compilerOptions:{isCustomElement:r=>!r.includes("v-")&&r.includes("-")}}}),M({autoImport:!0}),e==="development"&&{name:"inject-html",configureServer:G}],customLogger:g,define:{"process.env":{}},resolve:{alias:{"@":t.join(c,"core/client"),"^":t.join(c,"widgets"),"user:config":m,"user:widgets":D},extensions:[".js",".json",".jsx",".mjs",".ts",".tsx",".vue"]},server:{warmup:{clientFiles:[t.join(c,"core/client/**"),m]},port:o.port??3e3,open:o.open,fs:{allow:[W(process.cwd())]},host:o.host},root:c,...e==="development"&&{optimizeDeps:{include:["webfontloader","vuetify","vue","pinia","stac-js","urijs","loglevel","color-legend-element"],noDiscovery:!0}},publicDir:o.publicDir===!1?!1:z,build:{outDir:v,emptyOutDir:!0,target:"esnext",cssMinify:!0,...o.lib&&a==="build"&&{minify:!1,lib:{entry:t.join(c,"core/client/asWebComponent.js"),fileName:"eo-dash",formats:["es"],name:"@eodash/eodash"},rollupOptions:{input:t.join(c,"core/client/asWebComponent.js"),external:r=>{const i=r.includes("vuetify")||r.endsWith(".css")||r.endsWith("styles"),n=V.some(l=>r.startsWith(l));return!i&&n}}}}})),k=w(async e=>o.vite?F(await x(e),o.vite):x(e));async function G(e){e.watcher.add([m,p,t.join(D,"**/*.vue")]);let a="";const r=g.info;return g.info=(i,n)=>{if(i.includes("core")){const l=i.split("/")[0].split(" ");l.pop();const d=l.join(" ")+" "+a.replace(s,"");return r(d,n)}return r(i,n)},e.watcher.on("change",async i=>{a=i,i===p&&e.ws.send({type:"full-reload",path:i})}),()=>{e.middlewares.use(async(i,n,l)=>{if(i.originalUrl==="/@fs/config.js"||i.originalUrl==="/config.js"){n.statusCode=200,n.setHeader("Content-Type","text/javascript"),u(p)&&await T(p).then(d=>{n.write(d)}),n.end();return}if(i.url?.endsWith(".html")){n.statusCode=200,n.setHeader("Content-Type","text/html");const d=await e.transformIndexHtml(i.url,C,i.originalUrl);n.end(d);return}l()})}}const K=async()=>{const e=await O(await k({mode:"development",command:"serve"}));await e.listen(),e.printUrls(),e.bindCLIShortcuts({print:!0})},Q=async()=>{const e=async()=>{const a=await k({mode:"production",command:"build"});await N(a),u(p)&&await A(p,t.join(v,"config.js"),{recursive:!0}).catch(r=>{console.error(r)})};if(o.lib)await e();else{const a=t.join(c,"/index.html");await $(a,C).then(async()=>{await e(),await L(a).catch(()=>{console.error("failed to remove index.html")})})}};async function X(){(await U({root:s,base:o.base??"",preview:{port:isNaN(o.port)?8080:o.port,open:o.open,host:o.host},build:{outDir:v}})).printUrls()}const Z=process.argv?.[2];(async()=>{switch(Z){case"dev":await K();break;case"build":await Q();break;case"preview":await X();break;default:console.error("command not found");break}})();
@@ -258,7 +258,7 @@ export interface EodashStore {
258
258
  getLayers: (el?: string) => object[];
259
259
 
260
260
  /**
261
- * Register EPSG projection in `eox-map` and adds it to {@link EodashStore.states.availableMapProjection `availableMapProjection`` }
261
+ * Register EPSG projection in `eox-map` and adds it to `availableMapProjection`
262
262
  * */
263
263
  registerProjection: (
264
264
  code?: number | string | { name: string; def: string },
@@ -276,4 +276,4 @@ export interface EodashStore {
276
276
  };
277
277
  }
278
278
  ///////
279
- export * from "./main"
279
+ export { createEodash, store } from "./main.js";
@@ -6,8 +6,9 @@
6
6
  * @param {import("ol/layer/WebGLTile").Style} [style]
7
7
  * @param {Record<string, unknown>} [layerConfig]
8
8
  * @param {Record<string, unknown>} [layerDatetime]
9
+ * @param {object | null} [extraProperties]
9
10
  **/
10
- export function createLayersFromAssets(collectionId: string, title: string, assets: Record<string, import("stac-ts").StacAsset>, item: import("stac-ts").StacItem, style?: import("ol/layer/WebGLTile").Style | undefined, layerConfig?: Record<string, unknown> | undefined, layerDatetime?: Record<string, unknown> | undefined): Promise<({
11
+ export function createLayersFromAssets(collectionId: string, title: string, assets: Record<string, import("stac-ts").StacAsset>, item: import("stac-ts").StacItem, style?: import("ol/layer/WebGLTile").Style | undefined, layerConfig?: Record<string, unknown> | undefined, layerDatetime?: Record<string, unknown> | undefined, extraProperties?: object | null | undefined): Promise<({
11
12
  style?: import("ol/layer/WebGLTile").Style | undefined;
12
13
  type: string;
13
14
  source: {
@@ -41,4 +42,4 @@ export function createLayersFromAssets(collectionId: string, title: string, asse
41
42
  };
42
43
  style: import("ol/layer/WebGLTile").Style | undefined;
43
44
  })[]>;
44
- export function createLayersFromLinks(collectionId: string, title: string, item: import("stac-ts").StacItem, layerDatetime?: Record<string, any> | undefined, legendInfo?: string | null | undefined): Promise<Record<string, any>[]>;
45
+ export function createLayersFromLinks(collectionId: string, title: string, item: import("stac-ts").StacItem, layerDatetime?: Record<string, any> | undefined, extraProperties?: object | null | undefined): Promise<Record<string, any>[]>;
@@ -15,13 +15,17 @@ export function generateFeatures(links?: import("stac-ts").StacLink[] | undefine
15
15
  };
16
16
  }[];
17
17
  };
18
- /** @param { import("ol/layer/WebGLTile").Style & { jsonform?: Record<string,any> } } [style] */
18
+ /** @param { import("ol/layer/WebGLTile").Style & { jsonform?: Record<string,any> } & { legend?: Record<string,any> } } [style] */
19
19
  export function extractLayerConfig(style?: (import("ol/layer/WebGLTile").Style & {
20
20
  jsonform?: Record<string, any>;
21
+ } & {
22
+ legend?: Record<string, any>;
21
23
  }) | undefined): {
22
24
  layerConfig: Record<string, unknown> | undefined;
23
25
  style: (import("ol/layer/WebGLTile").Style & {
24
26
  jsonform?: Record<string, any>;
27
+ } & {
28
+ legend?: Record<string, any>;
25
29
  }) | undefined;
26
30
  };
27
31
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eodash/eodash",
3
- "version": "5.0.0-alpha.2.23",
3
+ "version": "5.0.0-alpha.2.24",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "core/client",
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "@eox/itemfilter": "^1.1.1",
52
52
  "@eox/jsonform": "^0.8.2",
53
- "@eox/layercontrol": "^0.21.0",
53
+ "@eox/layercontrol": "^0.22.0",
54
54
  "@eox/layout": "^0.1.0",
55
55
  "@eox/map": "^1.13.1",
56
56
  "@eox/stacinfo": "^0.3.3",
@@ -60,6 +60,7 @@
60
60
  "animated-details": "gist:2912bb049fa906671807415eb0e87188",
61
61
  "axios": "^1.7.7",
62
62
  "axios-cache-interceptor": "^1.6.0",
63
+ "color-legend-element": "^1.3.0",
63
64
  "commander": "^12.1.0",
64
65
  "core-js": "^3.38.1",
65
66
  "loglevel": "^1.9.2",
@@ -3,7 +3,7 @@
3
3
  <eox-layercontrol
4
4
  v-if="showControls"
5
5
  :for="mapElement"
6
- .tools="['datetime', 'info', 'config', 'opacity']"
6
+ .tools="['datetime', 'info', 'config', 'legend', 'opacity']"
7
7
  @datetime:updated="debouncedHandleDateTime"
8
8
  class="fill-height"
9
9
  toolsAsList="true"
@@ -15,6 +15,7 @@
15
15
  import "@eox/layercontrol";
16
16
  import "@eox/jsonform";
17
17
  import "@eox/timecontrol";
18
+ import "color-legend-element";
18
19
 
19
20
  import { computed, ref } from "vue";
20
21
  import { mapEl, mapCompareEl } from "@/store/States";