@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
@@ -1,6 +1,6 @@
1
1
  import { watch, onScopeDispose, effectScope, capitalize, reactive, watchEffect, toRef, shallowRef, Fragment, warn, getCurrentInstance as getCurrentInstance$1, ref, computed, unref, provide, inject as inject$1, defineComponent as defineComponent$1, h, camelize, toRaw, toRefs, toValue, createVNode, mergeProps, createElementVNode, normalizeClass, getCurrentScope, onBeforeUnmount, readonly, onMounted, useId, onDeactivated, onActivated, nextTick, shallowReactive, onUnmounted, isRef, normalizeStyle, onUpdated, Text, Transition, resolveDynamicComponent, withDirectives, toDisplayString, useModel, createBlock, createCommentVNode, openBlock, withCtx, createTextVNode, defineAsyncComponent, onErrorCaptured, Suspense, createElementBlock, normalizeProps, withAsyncContext, defineCustomElement } from 'vue';
2
2
  import { storeToRefs, defineStore, createPinia } from 'pinia';
3
- import { r as registerProjection, c as createLayerID, e as extractRoles, g as getProjectionCode, f as fetchStyle, a as extractLayerConfig, b as addTooltipInteraction, d as createAssetID, m as mergeGeojsons, h as mapEl, i as isSTACItem, j as axios, k as extractLayerTimeValues, l as fetchApiItems, n as getDatetimeProperty, o as fetchAllStyles, p as getLayers, q as getCompareLayers, s as findLayer, t as findLayersByLayerPrefix, u as replaceLayersInStructure, v as generateFeatures, w as extractLayerLegend, x as extractCollectionUrls, y as generateLinksFromItems, z as revokeCollectionBlobUrls, A as currentUrl, B as datetime, C as poi, D as activeTemplate, E as mapPosition, F as indicator, G as currentCompareUrl, H as compareIndicator, I as comparePoi, J as states, K as actions } from './helpers-CtUlAW0N.js';
3
+ import { r as registerProjection, c as createLayerID, e as extractRoles, a as extractEoxLegendLink, g as getProjectionCode, f as fetchStyle, b as extractLayerConfig, d as axios, h as addTooltipInteraction, i as createAssetID, m as mergeGeojsons, j as mapEl, k as isSTACItem, l as extractLayerTimeValues, n as fetchApiItems, o as getDatetimeProperty, p as fetchAllStyles, q as getLayers, s as getCompareLayers, t as findLayer, u as findLayersByLayerPrefix, v as replaceLayersInStructure, w as generateFeatures, x as extractLayerLegend, y as extractCollectionUrls, z as generateLinksFromItems, A as revokeCollectionBlobUrls, B as currentUrl, C as datetime, D as poi, E as activeTemplate, F as mapPosition, G as indicator, H as currentCompareUrl, I as compareIndicator, J as comparePoi, K as states, L as actions } from './helpers-CsjKHAcK.js';
4
4
  import log from 'loglevel';
5
5
  import { useEventBus, useMutationObserver, createSharedComposable } from '@vueuse/core';
6
6
  import { mdiWrench, mdiSnowflake, mdiVolleyball, mdiHiking, mdiLightningBolt, mdiLeaf, mdiAccountMultiple, mdiCurrencyEur, mdiWeatherWindy, mdiSetCenter, mdiHospitalBoxOutline, mdiImageFilterHdr, mdiWater, mdiBarley, mdiClose, mdiAlertCircle, mdiPlus, mdiMenuDown, mdiChevronLeft, mdiChevronRight } from '@mdi/js';
@@ -3621,9 +3621,7 @@ function setQueryParam(url, key, value) {
3621
3621
  * @param {string} collectionId
3622
3622
  * @param {string} title
3623
3623
  * @param {Record<string,import("stac-ts").StacAsset>} assets
3624
- * @param {import("stac-ts").StacItem } item
3625
- * @param {import("@/types").EodashStyleJson} [style]
3626
- * @param {Record<string, unknown>} [layerConfig]
3624
+ * @param {import("stac-ts").StacItem | import("stac-ts").StacCollection } stacObject
3627
3625
  * @param {Record<string, unknown>} [layerDatetime]
3628
3626
  * @param {object | null} [extraProperties]
3629
3627
  **/
@@ -3631,80 +3629,40 @@ async function createLayersFromAssets(
3631
3629
  collectionId,
3632
3630
  title,
3633
3631
  assets,
3634
- item,
3635
- style,
3636
- layerConfig,
3632
+ stacObject,
3637
3633
  layerDatetime,
3638
3634
  extraProperties,
3639
3635
  ) {
3640
3636
  log.debug("Creating layers from assets");
3641
- let jsonArray = [];
3642
- let geoTIFFSources = [];
3643
- /** @type {number|null} */
3644
- let geoTIFFIdx = null;
3645
-
3646
- let geoJsonIdx = 0;
3647
- let geoJsonAttributions = [];
3637
+ const jsonArray = [];
3638
+ const geoTIFFSources = [];
3639
+ const geoTIFFIdx = [];
3648
3640
 
3649
3641
  const geoJsonSources = [];
3650
- let geoJsonRoles = {};
3651
- let projection = undefined;
3652
- for (const [idx, ast] of Object.keys(assets).entries()) {
3653
- // register projection if exists
3654
- const assetProjection =
3655
- /** @type {string | number | {name: string, def: string, extent?:number[]} | undefined} */ (
3656
- assets[ast]?.["proj:epsg"] || assets[ast]?.["eodash:proj4_def"]
3657
- );
3658
- await registerProjection(assetProjection);
3659
- projection = getProjectionCode(assetProjection) || "EPSG:4326";
3660
- if (assets[ast]?.type === "application/geo+json") {
3661
- geoJsonSources.push(assets[ast].href);
3662
- geoJsonIdx = idx;
3663
- if (assets[ast].attribution)
3664
- geoJsonAttributions.push(assets[ast].attribution);
3665
- extractRoles(geoJsonRoles, assets[ast]);
3666
- } else if (assets[ast]?.type === "application/vnd.flatgeobuf") {
3667
- const assetId = createAssetID(collectionId, item.id, idx);
3668
- log.debug(`Creating Vector layer from FlatGeoBuf`, assetId);
3669
-
3670
- const layer = {
3671
- type: "Vector",
3672
- source: {
3673
- type: "FlatGeoBuf",
3674
- url: assets[ast].href,
3675
- projection,
3676
- attributions: assets[ast].attribution,
3677
- },
3678
- properties: {
3679
- id: assetId,
3680
- title,
3681
- layerDatetime,
3682
- ...(layerConfig && {
3683
- layerConfig: {
3684
- ...layerConfig,
3685
- style,
3686
- },
3687
- }),
3688
- },
3689
- ...(!style?.variables && { style }),
3690
- interactions: [],
3691
- };
3692
- // add tooltip interaction if style has tooltip
3693
- addTooltipInteraction(layer, style);
3694
-
3695
- extractRoles(layer.properties, assets[ast]);
3696
-
3697
- layer.properties = { ...layer.properties, ...(extraProperties ?? {}) };
3698
-
3699
- jsonArray.push(layer);
3700
- } else if (assets[ast]?.type === "image/tiff") {
3701
- geoTIFFIdx = idx;
3642
+ const geoJsonIdx = [];
3643
+
3644
+ const fgbIdx = [];
3645
+ const fgbSources = [];
3646
+ const assetIds = [];
3647
+
3648
+ for (const [idx, assetId] of Object.keys(assets).entries()) {
3649
+ assetIds.push(assetId);
3650
+
3651
+ if (assets[assetId]?.type === "application/geo+json") {
3652
+ geoJsonSources.push(assets[assetId].href);
3653
+ geoJsonIdx.push(idx);
3654
+ } else if (assets[assetId]?.type === "application/vnd.flatgeobuf") {
3655
+ fgbSources.push(assets[assetId].href);
3656
+ fgbIdx.push(idx);
3657
+ } else if (assets[assetId]?.type === "image/tiff") {
3658
+ geoTIFFIdx.push(idx);
3702
3659
  geoTIFFSources.push({
3703
- url: assets[ast].href,
3704
- attributions: assets[ast].attribution,
3660
+ url: assets[assetId].href,
3661
+ attributions: assets[assetId].attribution,
3705
3662
  });
3706
- } else if (assets[ast]?.type === "application/geodb+json") {
3707
- const responseData = await (await fetch(assets[ast].href)).json();
3663
+ } else if (assets[assetId]?.type === "application/geodb+json") {
3664
+ const responseData = await (await fetch(assets[assetId].href)).json();
3665
+ geoJsonIdx.push(idx);
3708
3666
  if (
3709
3667
  !responseData ||
3710
3668
  !Array.isArray(responseData) ||
@@ -3764,61 +3722,179 @@ async function createLayersFromAssets(
3764
3722
  }
3765
3723
 
3766
3724
  if (geoJsonSources.length) {
3767
- const assetId = createAssetID(collectionId, item.id, geoJsonIdx);
3768
- log.debug(`Creating Vector layer from GeoJsons`, assetId);
3769
- // assumption that each GeoJSON asset is in same projection due to their merging
3770
- const layer = {
3771
- type: "Vector",
3772
- source: {
3773
- type: "Vector",
3774
- url: await mergeGeojsons(geoJsonSources),
3775
- format: { type: "GeoJSON", dataProjection: projection },
3776
- attributions: geoJsonAttributions,
3777
- },
3778
- properties: {
3779
- ...geoJsonRoles,
3780
- id: assetId,
3781
- title,
3782
- layerDatetime,
3783
- ...(layerConfig && {
3784
- layerConfig: {
3785
- ...layerConfig,
3786
- style,
3787
- },
3788
- }),
3789
- },
3790
- ...(!style?.variables && { style }),
3791
- interactions: [],
3792
- };
3725
+ for (const [i, geoJsonSource] of geoJsonSources.entries()) {
3726
+ // fetch styles and separate them by their mapping between links and assets
3727
+ const assetName = assetIds[geoJsonIdx[i]];
3728
+ const styles = await fetchStyle(stacObject, undefined, assetName);
3729
+ // get the correct style which is not attached to a link
3730
+ let { layerConfig, style } = extractLayerConfig(collectionId, styles);
3731
+ let assetLayerId = createAssetID(
3732
+ collectionId,
3733
+ stacObject.id,
3734
+ geoJsonIdx[i],
3735
+ );
3736
+ if (
3737
+ assets[assetName]?.roles?.includes("overlay") ||
3738
+ assets[assetName]?.roles?.includes("baselayer")
3739
+ ) {
3740
+ // to prevent them being removed by date change on main dataset
3741
+ assetLayerId = assetName;
3742
+ }
3793
3743
 
3794
- layer.properties = { ...layer.properties, ...(extraProperties ?? {}) };
3795
- addTooltipInteraction(layer, style);
3796
- jsonArray.push(layer);
3797
- }
3798
- if (geoTIFFSources.length && typeof geoTIFFIdx === "number") {
3799
- const geotiffSourceID = collectionId + ";:;GeoTIFF";
3800
- log.debug("Creating WebGLTile layer from GeoTIFF", geotiffSourceID);
3801
- log.debug("Configured Sources", geoTIFFSources);
3802
- const layer = {
3803
- type: "WebGLTile",
3804
- source: {
3805
- type: "GeoTIFF",
3806
- normalize: !style,
3807
- interpolate: false,
3808
- sources: geoTIFFSources,
3809
- },
3810
- properties: {
3811
- id: createAssetID(collectionId, item.id, geoTIFFIdx),
3812
- title,
3813
- layerConfig,
3814
- layerDatetime,
3815
- },
3816
- style,
3817
- };
3818
- if (extraProperties) {
3819
- layer.properties = { ...layer.properties, ...extraProperties };
3744
+ log.debug(`Creating Vector layer from GeoJsons`, assetLayerId);
3745
+ // register projection if exists
3746
+ const assetProjection =
3747
+ /** @type {string | number | {name: string, def: string, extent?:number[]} | undefined} */ (
3748
+ assets[assetName]?.["proj:epsg"] ||
3749
+ assets[assetName]?.["eodash:proj4_def"]
3750
+ );
3751
+ await registerProjection(assetProjection);
3752
+ const projection = getProjectionCode(assetProjection) || "EPSG:4326";
3753
+ const geoJSONURL =
3754
+ stacObject?.["eodash:merge_assets"] === false
3755
+ ? geoJsonSource
3756
+ : await mergeGeojsons(geoJsonSources);
3757
+
3758
+ const layer = {
3759
+ type: "Vector",
3760
+ source: {
3761
+ type: "Vector",
3762
+ url: geoJSONURL,
3763
+ format: { type: "GeoJSON", dataProjection: projection },
3764
+ attributions: assets[assetName].attribution,
3765
+ },
3766
+ properties: {
3767
+ id: assetLayerId,
3768
+ title: assets[assetName]?.title || title,
3769
+ layerDatetime,
3770
+ ...(layerConfig && {
3771
+ layerConfig: {
3772
+ ...layerConfig,
3773
+ style,
3774
+ },
3775
+ }),
3776
+ },
3777
+ ...(!style?.variables && { style }),
3778
+ interactions: [],
3779
+ };
3780
+ layer.properties = { ...layer.properties, ...(extraProperties ?? {}) };
3781
+ extractRoles(layer.properties, assets[assetName]);
3782
+ addTooltipInteraction(layer, style);
3783
+ jsonArray.push(layer);
3784
+ // if we merged assets (default yes), then we can break from this loop
3785
+ if (stacObject?.["eodash:merge_assets"] !== false) break;
3786
+ }
3787
+ }
3788
+ if (fgbSources.length) {
3789
+ for (const [i, fgbSource] of fgbSources.entries()) {
3790
+ // fetch styles and separate them by their mapping between links and assets
3791
+ const assetName = assetIds[fgbIdx[i]];
3792
+ const styles = await fetchStyle(stacObject, undefined, assetName);
3793
+ // get the correct style which is not attached to a link
3794
+ let { layerConfig, style } = extractLayerConfig(collectionId, styles);
3795
+ let assetLayerId = createAssetID(collectionId, stacObject.id, fgbIdx[i]);
3796
+ if (
3797
+ assets[assetName]?.roles?.includes("overlay") ||
3798
+ assets[assetName]?.roles?.includes("baselayer")
3799
+ ) {
3800
+ // to prevent them being removed by date change on main dataset
3801
+ assetLayerId = assetName;
3802
+ }
3803
+ log.debug(`Creating Vector layer from FlatGeoBuf`, assetLayerId);
3804
+ // register projection if exists
3805
+ const assetProjection =
3806
+ /** @type {string | number | {name: string, def: string, extent?:number[]} | undefined} */ (
3807
+ assets[assetName]?.["proj:epsg"] ||
3808
+ assets[assetName]?.["eodash:proj4_def"]
3809
+ );
3810
+ await registerProjection(assetProjection);
3811
+ const projection = getProjectionCode(assetProjection) || "EPSG:4326";
3812
+ // in case we merge them, we pass urls, else just single url
3813
+ const urlsObject = {
3814
+ url: fgbSource,
3815
+ // TODO uncomment this once fgb merging supported on source
3816
+ // url: stacObject?.["eodash:merge_assets"] === false ? fgbSource : undefined,
3817
+ // urls: stacObject?.["eodash:merge_assets"] !== false ? fgbSources : undefined,
3818
+ };
3819
+ const layer = {
3820
+ type: "Vector",
3821
+ source: {
3822
+ ...urlsObject,
3823
+ type: "FlatGeoBuf",
3824
+ projection,
3825
+ attributions: assets[assetName].attribution,
3826
+ },
3827
+ properties: {
3828
+ id: assetLayerId,
3829
+ title: assets[assetName]?.title || title,
3830
+ layerDatetime,
3831
+ ...(layerConfig && {
3832
+ layerConfig: {
3833
+ ...layerConfig,
3834
+ style,
3835
+ },
3836
+ }),
3837
+ },
3838
+ ...(!style?.variables && { style }),
3839
+ interactions: [],
3840
+ };
3841
+ layer.properties = { ...layer.properties, ...(extraProperties ?? {}) };
3842
+ extractRoles(layer.properties, assets[assetName]);
3843
+ addTooltipInteraction(layer, style);
3844
+ jsonArray.push(layer);
3845
+ // if we merged assets (default yes), then we can break from this loop
3846
+ // TODO uncomment this once fgb merging supported on source
3847
+ // if (stacObject?.["eodash:merge_assets"] !== false)
3848
+ // break
3849
+ }
3850
+ }
3851
+
3852
+ if (geoTIFFSources.length) {
3853
+ for (const [i, geotiffSource] of geoTIFFSources.entries()) {
3854
+ const assetName = assetIds[geoTIFFIdx[i]];
3855
+ const styles = await fetchStyle(stacObject, undefined, assetName);
3856
+ // get the correct style which is not attached to a link
3857
+ let { layerConfig, style } = extractLayerConfig(collectionId, styles);
3858
+ let assetLayerId = createAssetID(
3859
+ collectionId,
3860
+ stacObject.id,
3861
+ geoTIFFIdx[i],
3862
+ );
3863
+ if (
3864
+ assets[assetName]?.roles?.includes("overlay") ||
3865
+ assets[assetName]?.roles?.includes("baselayer")
3866
+ ) {
3867
+ // to prevent them being removed by date change on main dataset
3868
+ assetLayerId = assetName;
3869
+ }
3870
+ log.debug("Creating WebGLTile layer from GeoTIFF", assetLayerId);
3871
+ log.debug("Configured Sources", geoTIFFSources);
3872
+ const sources =
3873
+ stacObject?.["eodash:merge_assets"] !== false ? geoTIFFSources : geotiffSource;
3874
+ const layer = {
3875
+ type: "WebGLTile",
3876
+ source: {
3877
+ type: "GeoTIFF",
3878
+ normalize: !style,
3879
+ interpolate: false,
3880
+ sources,
3881
+ },
3882
+ properties: {
3883
+ id: assetLayerId,
3884
+ title,
3885
+ layerConfig,
3886
+ layerDatetime,
3887
+ },
3888
+ style,
3889
+ };
3890
+ if (extraProperties) {
3891
+ layer.properties = { ...layer.properties, ...extraProperties };
3892
+ }
3893
+ extractRoles(layer.properties, assets[assetName]);
3894
+ addTooltipInteraction(layer, style);
3895
+ jsonArray.push(layer);
3896
+ if (stacObject?.["eodash:merge_assets"] !== false) break;
3820
3897
  }
3821
- jsonArray.push(layer);
3822
3898
  }
3823
3899
 
3824
3900
  return jsonArray;
@@ -3828,17 +3904,17 @@ async function createLayersFromAssets(
3828
3904
  * @param {string} collectionId
3829
3905
  * @param {import('stac-ts').StacItem} item
3830
3906
  * @param {string} title
3831
- * @param {string} itemUrl
3832
3907
  * @param {Record<string,any>} [layerDatetime]
3833
3908
  * @param {object | null} [extraProperties]
3909
+ * @param {import('stac-ts').StacCollection} [collection]
3834
3910
  */
3835
3911
  const createLayersFromLinks = async (
3836
3912
  collectionId,
3837
3913
  title,
3838
3914
  item,
3839
- itemUrl,
3840
3915
  layerDatetime,
3841
3916
  extraProperties,
3917
+ collection,
3842
3918
  ) => {
3843
3919
  log.debug("Creating layers from links");
3844
3920
  /** @type {Record<string,any>[]} */
@@ -3855,7 +3931,6 @@ const createLayersFromLinks = async (
3855
3931
 
3856
3932
  for (const wmsLink of wmsArray ?? []) {
3857
3933
  // Registering setting sub wms link projection
3858
-
3859
3934
  const wmsLinkProjection =
3860
3935
  /** @type {number | string | {name: string, def: string} | undefined} */
3861
3936
  (wmsLink?.["proj:epsg"] || wmsLink?.["eodash:proj4_def"]);
@@ -3908,8 +3983,12 @@ const createLayersFromLinks = async (
3908
3983
  // Expand all dimensions into the params attribute
3909
3984
  Object.assign(json.source.params, wmsLink["wms:dimensions"]);
3910
3985
  }
3986
+ if ("wms:styles" in wmsLink) {
3987
+ // @ts-expect-error no type for eox-map
3988
+ json.source.params["STYLES"] = wmsLink["wms:styles"];
3989
+ }
3911
3990
  if (extraProperties !== null) {
3912
- json.properties = { ...json.properties, ...extraProperties };
3991
+ json.properties = { ...json.properties, ...extraProperties, ...extractEoxLegendLink(wmsLink) };
3913
3992
  }
3914
3993
  jsonArray.push(json);
3915
3994
  }
@@ -3922,6 +4001,12 @@ const createLayersFromLinks = async (
3922
4001
  (wmtsLink?.["proj:epsg"] || wmtsLink?.["eodash:proj4_def"]);
3923
4002
 
3924
4003
  await registerProjection(wmtsLinkProjection);
4004
+ const key =
4005
+ /** @type {string | undefined} */ (wmtsLink["key"]) || undefined;
4006
+
4007
+ const styles = await fetchStyle(item, key);
4008
+ // get the correct style which is attached to a link
4009
+ const returnedLayerConfig = extractLayerConfig(collectionId, styles, undefined, "tileUrl");
3925
4010
  const projectionCode = getProjectionCode(wmtsLinkProjection || "EPSG:3857");
3926
4011
  // TODO: WARNING! This is a temporary project specific implementation
3927
4012
  // that needs to be removed once catalog and wmts creation from capabilities
@@ -3939,6 +4024,17 @@ const createLayersFromLinks = async (
3939
4024
  let { style, ...dimensionsWithoutStyle } = { ...dimensions };
3940
4025
  let extractedStyle = /** @type { string } */ (style || "default");
3941
4026
 
4027
+ // TODO, this does not yet work between layer time changes because we do not get
4028
+ // updated variables from OL layer due to usage of tileurlfunction
4029
+
4030
+ // update dimensions with current value of style variables if applicable
4031
+ const variables = returnedLayerConfig?.style?.variables;
4032
+ if (variables) {
4033
+ for (const [kk, vv] of Object.entries(variables)) {
4034
+ dimensionsWithoutStyle[kk] = vv;
4035
+ }
4036
+ }
4037
+
3942
4038
  if (wmtsLink.title === "wmts capabilities") {
3943
4039
  log.debug(
3944
4040
  "Warning: WMTS Layer from capabilities added, function needs to be updated",
@@ -3950,6 +4046,7 @@ const createLayersFromLinks = async (
3950
4046
  id: linkId,
3951
4047
  title: title || item.id,
3952
4048
  layerDatetime,
4049
+ layerConfig: returnedLayerConfig.layerConfig,
3953
4050
  },
3954
4051
  source: {
3955
4052
  type: "WMTS",
@@ -3996,7 +4093,7 @@ const createLayersFromLinks = async (
3996
4093
  }
3997
4094
  extractRoles(json.properties, wmtsLink);
3998
4095
  if (extraProperties !== null) {
3999
- json.properties = { ...json.properties, ...extraProperties };
4096
+ json.properties = { ...json.properties, ...extraProperties, ...extractEoxLegendLink(wmtsLink) };
4000
4097
  }
4001
4098
  jsonArray.push(json);
4002
4099
  }
@@ -4005,7 +4102,18 @@ const createLayersFromLinks = async (
4005
4102
  const xyzLinkProjection =
4006
4103
  /** @type {number | string | {name: string, def: string} | undefined} */
4007
4104
  (xyzLink?.["proj:epsg"] || xyzLink?.["eodash:proj4_def"]);
4008
-
4105
+ const key =
4106
+ /** @type {string | undefined} */ (xyzLink["key"]) || undefined;
4107
+ const rasterformURL = /** @type {string|undefined} */ (
4108
+ collection?.["eodash:rasterform"]
4109
+ );
4110
+ /** @type {import("@/types").EodashRasterJSONForm|undefined} */
4111
+ const rasterForm = rasterformURL
4112
+ ? await axios.get(rasterformURL).then((resp) => resp.data)
4113
+ : undefined;
4114
+ const styles = await fetchStyle(item, key);
4115
+ // get the correct style which is attached to a link
4116
+ let { layerConfig, style } = extractLayerConfig(collectionId, styles, rasterForm, "tileUrl");
4009
4117
  await registerProjection(xyzLinkProjection);
4010
4118
  const projectionCode = getProjectionCode(xyzLinkProjection || "EPSG:3857");
4011
4119
  const linkId = createLayerID(
@@ -4014,6 +4122,22 @@ const createLayersFromLinks = async (
4014
4122
  xyzLink,
4015
4123
  viewProjectionCode,
4016
4124
  );
4125
+ let xyzUrl = xyzLink.href;
4126
+
4127
+ // TODO, this does not yet work between layer time changes because we do not get
4128
+ // updated variables from OL layer due to usage of tileurlfunction
4129
+
4130
+ // update url query params with current value of style variables if applicable
4131
+ const variables = style?.variables;
4132
+ if (variables) {
4133
+ const [base, query] = xyzUrl.split("?");
4134
+ const params = new URLSearchParams(query);
4135
+ for (const [kk, vv] of Object.entries(variables)) {
4136
+ params.set(kk, JSON.stringify(vv));
4137
+ }
4138
+ xyzUrl = `${base}?${params.toString()}`;
4139
+ }
4140
+
4017
4141
  log.debug("XYZ Layer added", linkId);
4018
4142
  let json = {
4019
4143
  type: "Tile",
@@ -4022,10 +4146,11 @@ const createLayersFromLinks = async (
4022
4146
  title: xyzLink.title || title || item.id,
4023
4147
  roles: xyzLink.roles,
4024
4148
  layerDatetime,
4149
+ layerConfig,
4025
4150
  },
4026
4151
  source: {
4027
4152
  type: "XYZ",
4028
- url: xyzLink.href,
4153
+ url: xyzUrl,
4029
4154
  projection: projectionCode,
4030
4155
  attributions: xyzLink.attribution,
4031
4156
  },
@@ -4033,7 +4158,7 @@ const createLayersFromLinks = async (
4033
4158
 
4034
4159
  extractRoles(json.properties, xyzLink);
4035
4160
  if (extraProperties !== null) {
4036
- json.properties = { ...json.properties, ...extraProperties };
4161
+ json.properties = { ...json.properties, ...extraProperties, ...extractEoxLegendLink(xyzLink) };
4037
4162
  }
4038
4163
  jsonArray.push(json);
4039
4164
  }
@@ -4057,9 +4182,9 @@ const createLayersFromLinks = async (
4057
4182
  const key =
4058
4183
  /** @type {string | undefined} */ (vectorTileLink["key"]) || undefined;
4059
4184
  // fetch styles and separate them by their mapping between links and assets
4060
- const styles = await fetchStyle(item, itemUrl, key);
4185
+ const styles = await fetchStyle(item, key);
4061
4186
  // get the correct style which is not attached to a link
4062
- let { layerConfig, style } = extractLayerConfig(linkId ?? "", styles);
4187
+ let { layerConfig, style } = extractLayerConfig(collectionId, styles);
4063
4188
 
4064
4189
  let href = vectorTileLink.href;
4065
4190
  if ("auth:schemes" in item && "auth:refs" in vectorTileLink) {
@@ -4100,7 +4225,7 @@ const createLayersFromLinks = async (
4100
4225
  addTooltipInteraction(json, style);
4101
4226
  extractRoles(json.properties, vectorTileLink);
4102
4227
  if (extraProperties !== null) {
4103
- json.properties = { ...json.properties, ...extraProperties };
4228
+ json.properties = { ...json.properties, ...extraProperties, ...extractEoxLegendLink(vectorTileLink) };
4104
4229
  }
4105
4230
  jsonArray.push(json);
4106
4231
  }
@@ -4112,18 +4237,31 @@ const createLayersFromLinks = async (
4112
4237
  * @param {import("stac-ts").StacItem | undefined | null} item
4113
4238
  * @param {string} rasterURL
4114
4239
  * @param {Record<string, any>} [extraProperties]
4115
- * @returns {import("@eox/map/src/layers").EOxLayerType<"Tile","XYZ">[]}
4240
+ * @returns {Promise<import("@eox/map/src/layers").EOxLayerType<"Tile","XYZ">[]>}
4116
4241
  */
4117
- function createLayerFromRender(
4242
+ const createLayerFromRender = async (
4118
4243
  rasterURL,
4119
4244
  collection,
4120
4245
  item,
4121
4246
  extraProperties,
4122
- ) {
4247
+ ) => {
4123
4248
  if (!collection || !collection.renders || !item) {
4124
4249
  return [];
4125
4250
  }
4126
4251
 
4252
+ const rasterformURL = /** @type {string|undefined} */ (
4253
+ collection?.["eodash:rasterform"]
4254
+ );
4255
+ /** @type {import("@/types").EodashRasterJSONForm|undefined} */
4256
+ const rasterForm = rasterformURL
4257
+ ? await axios.get(rasterformURL).then((resp) => resp.data)
4258
+ : undefined;
4259
+ let { layerConfig } = extractLayerConfig(
4260
+ collection.id,
4261
+ await fetchStyle(item),
4262
+ rasterForm,
4263
+ );
4264
+
4127
4265
  const renders = /** @type {Record<string,import("@/types").Render>} */ (
4128
4266
  collection.renders ?? item?.renders
4129
4267
  );
@@ -4174,6 +4312,9 @@ function createLayerFromRender(
4174
4312
  title,
4175
4313
  roles: item.roles,
4176
4314
  ...extraProperties,
4315
+ layerConfig: {
4316
+ ...layerConfig,
4317
+ },
4177
4318
  },
4178
4319
  source: {
4179
4320
  /** @type {"XYZ"} */
@@ -4185,7 +4326,7 @@ function createLayerFromRender(
4185
4326
  }
4186
4327
 
4187
4328
  return layers;
4188
- }
4329
+ };
4189
4330
  /**
4190
4331
  *
4191
4332
  * @param {Record<string,any>} obj
@@ -4337,25 +4478,19 @@ class EodashCollection {
4337
4478
  this.selectedItem = item;
4338
4479
  const title = this.#collectionStac?.title || this.#collectionStac?.id || "";
4339
4480
  layersJson.unshift(
4340
- ...(await this.buildJsonArray(
4341
- item,
4342
- stacItemUrl,
4343
- title,
4344
- isObservationPoint,
4345
- )),
4481
+ ...(await this.buildJsonArray(item, title, isObservationPoint)),
4346
4482
  );
4347
4483
  return layersJson;
4348
4484
  };
4349
4485
 
4350
4486
  /**
4351
4487
  * @param {import("stac-ts").StacItem} item
4352
- * @param {string} itemUrl
4353
4488
  * @param {string} title
4354
4489
  * @param {boolean} isObservationPoint
4355
4490
  * @param {string} [itemDatetime]
4356
4491
  * @returns {Promise<Record<string,any>[]>} layers
4357
4492
  * */
4358
- async buildJsonArray(item, itemUrl, title, isObservationPoint, itemDatetime) {
4493
+ async buildJsonArray(item, title, isObservationPoint, itemDatetime) {
4359
4494
  if (!item) {
4360
4495
  console.warn("[eodash] no item provided to buildJsonArray");
4361
4496
  return [];
@@ -4364,7 +4499,6 @@ class EodashCollection {
4364
4499
  log.debug(
4365
4500
  "Building JSON array",
4366
4501
  item,
4367
- itemUrl,
4368
4502
  title,
4369
4503
  isObservationPoint,
4370
4504
  itemDatetime,
@@ -4391,19 +4525,6 @@ class EodashCollection {
4391
4525
  // will try to extract anything it supports but for which we have
4392
4526
  // less control.
4393
4527
 
4394
- const rasterformURL = /** @type {string|undefined} */ (
4395
- this.#collectionStac?.["eodash:rasterform"]
4396
- );
4397
- /** @type {import("@/types").EodashRasterJSONForm|undefined} */
4398
- const rasterForm = rasterformURL
4399
- ? await axios.get(rasterformURL).then((resp) => resp.data)
4400
- : undefined;
4401
- let { layerConfig, style } = extractLayerConfig(
4402
- this.#collectionStac?.id ?? "",
4403
- await fetchStyle(item, itemUrl),
4404
- rasterForm,
4405
- );
4406
-
4407
4528
  const { layerDatetime, timeControlValues } = extractLayerTimeValues(
4408
4529
  await this.getItems(),
4409
4530
  item.properties?.datetime ??
@@ -4417,6 +4538,7 @@ class EodashCollection {
4417
4538
  }
4418
4539
  return data;
4419
4540
  }, /** @type {Record<string,import('stac-ts').StacAsset>} */ ({}));
4541
+
4420
4542
  const isSupported =
4421
4543
  item.links.some((link) =>
4422
4544
  ["wms", "xyz", "wmts", "vector-tile"].includes(link.rel),
@@ -4438,20 +4560,19 @@ class EodashCollection {
4438
4560
  this.#collectionStac?.id ?? "",
4439
4561
  title,
4440
4562
  item,
4441
- itemUrl,
4442
4563
  layerDatetime,
4443
4564
  extraProperties,
4565
+ this.#collectionStac,
4444
4566
  );
4445
4567
 
4446
4568
  jsonArray.push(
4447
4569
  ...((this.rasterEndpoint &&
4448
- createLayerFromRender(
4570
+ await createLayerFromRender(
4449
4571
  this.rasterEndpoint,
4450
4572
  this.#collectionStac,
4451
4573
  item,
4452
4574
  {
4453
4575
  ...extraProperties,
4454
- ...(layerConfig && { layerConfig }),
4455
4576
  ...(layerDatetime && { layerDatetime }),
4456
4577
  },
4457
4578
  )) ||
@@ -4461,8 +4582,6 @@ class EodashCollection {
4461
4582
  title || this.#collectionStac?.title || item.id,
4462
4583
  dataAssets,
4463
4584
  item,
4464
- style,
4465
- layerConfig,
4466
4585
  layerDatetime,
4467
4586
  extraProperties,
4468
4587
  )),
@@ -4470,6 +4589,10 @@ class EodashCollection {
4470
4589
  ...links,
4471
4590
  );
4472
4591
  } else {
4592
+ // get the correct style which is not attached to a link
4593
+ const id = this.#collectionStac?.id ?? "";
4594
+ const styles = await fetchStyle(item);
4595
+ let { layerConfig, style } = extractLayerConfig(id, styles);
4473
4596
  // fallback to STAC
4474
4597
  const json = {
4475
4598
  type: "STAC",
@@ -4477,7 +4600,7 @@ class EodashCollection {
4477
4600
  displayFootprint: false,
4478
4601
  data: item,
4479
4602
  properties: {
4480
- id: this.#collectionStac?.id ?? "",
4603
+ id,
4481
4604
  title: title || item.id,
4482
4605
  layerConfig,
4483
4606
  },
@@ -4611,10 +4734,7 @@ class EodashCollection {
4611
4734
  return [];
4612
4735
  }
4613
4736
  // get all style links, which could contribute by tooltip config and aggregate them
4614
- const styles = await fetchAllStyles(
4615
- this.selectedItem,
4616
- `${this.#collectionUrl}/${this.selectedItem.id}`,
4617
- );
4737
+ const styles = await fetchAllStyles(this.selectedItem);
4618
4738
  // get only unique ids to avoid duplicates
4619
4739
  const aggregatedTooltips = [
4620
4740
  ...new Map(
@@ -4658,7 +4778,6 @@ class EodashCollection {
4658
4778
  // if specifiedLink is an item, we create layers from it
4659
4779
  newLayers = await this.buildJsonArray(
4660
4780
  specifiedLink,
4661
- this.#collectionUrl + `/items/${specifiedLink.id}`,
4662
4781
  this.#collectionStac?.title || this.#collectionStac?.id || "",
4663
4782
  this.#collectionStac?.endpointtype === "GeoDB" ||
4664
4783
  !!this.#collectionStac?.locations,
@@ -4687,6 +4806,10 @@ class EodashCollection {
4687
4806
  newLayers,
4688
4807
  );
4689
4808
 
4809
+ // Emit event to update potential widget dependencies such as process layer ids
4810
+ const layersEvents = useEventBus(eoxLayersKey);
4811
+ layersEvents.emit("layertime:updated", newLayers);
4812
+
4690
4813
  return updatedLayers;
4691
4814
  }
4692
4815
 
@@ -4709,17 +4832,16 @@ class EodashCollection {
4709
4832
  );
4710
4833
 
4711
4834
  return [
4712
- //@ts-expect-error indicator instead of item
4713
4835
  ...(await createLayersFromLinks(
4714
4836
  indicator?.id ?? "",
4715
4837
  indicator?.title || indicator.id,
4838
+ //@ts-expect-error indicator instead of item
4716
4839
  indicator,
4717
4840
  )),
4718
4841
  ...(await createLayersFromAssets(
4719
4842
  indicator?.id ?? "",
4720
4843
  indicator?.title || indicator.id,
4721
4844
  indicatorAssets,
4722
- //@ts-expect-error indicator instead of item
4723
4845
  indicator,
4724
4846
  )),
4725
4847
  ];
@@ -4920,6 +5042,7 @@ function moveItemProperties(item) {
4920
5042
  "id",
4921
5043
  "collection",
4922
5044
  "properties",
5045
+ "auth:schemes"
4923
5046
  ];
4924
5047
  for (const key in item) {
4925
5048
  if (!stacProperties.includes(key)) {
@@ -5860,7 +5983,7 @@ const useSTAcStore = defineStore("stac", () => {
5860
5983
 
5861
5984
  const store = { stac: { useSTAcStore }, actions, states };
5862
5985
 
5863
- const useEodashRuntime = async (runtimeConfig) => {
5986
+ const useEodashRuntime = async (runtimeConfig = import.meta.env.EODASH_RUNTIME_CONFIG) => {
5864
5987
  let eodashConfig;
5865
5988
  const eodash = (
5866
5989
  /** @type {import("@/types").Eodash} */
@@ -8045,7 +8168,7 @@ const ErrorAlert = /*#__PURE__*/_export_sfc(_sfc_main$4, [['styles',[_style_0$2]
8045
8168
  const internalWidgets = (() => {
8046
8169
  /** @type {Record<string, () => Promise<import("vue").Component>>} */
8047
8170
  const importMap = {
8048
- .../* #__PURE__ */ Object.assign({"/widgets/EodashDatePicker.vue": () => import('./EodashDatePicker-Dewym-cx.js'),"/widgets/EodashItemCatalog/index.vue": () => import('./index-BxDh5v-H.js'),"/widgets/EodashItemFilter.vue": () => import('./EodashItemFilter-CAsZpOoQ.js'),"/widgets/EodashLayerControl.vue": () => import('./EodashLayerControl-fn-rt8Ac.js'),"/widgets/EodashLayoutSwitcher.vue": () => import('./EodashLayoutSwitcher-B9XqQXCS.js'),"/widgets/EodashMap/EodashMapBtns.vue": () => import('./EodashMapBtns-nFY6MIAX.js'),"/widgets/EodashMap/index.vue": () => import('./index-BkW06-Lg.js'),"/widgets/EodashProcess/ProcessList.vue": () => import('./ProcessList-DxyCFQdz.js').then(n => n.a),"/widgets/EodashProcess/index.vue": () => import('./index-BJvLt3Xf.js'),"/widgets/EodashStacInfo.vue": () => import('./EodashStacInfo-lxBKoav9.js'),"/widgets/EodashTimeSlider.vue": () => import('./EodashTimeSlider-DI97QkNT.js'),"/widgets/EodashTools.vue": () => import('./EodashTools-D5ShUT1g.js'),"/widgets/ExportState.vue": () => import('./ExportState-ruNyRS2E.js'),"/widgets/PopUp.vue": () => import('./PopUp-DRgOmD7-.js'),"/widgets/WidgetsContainer.vue": () => import('./WidgetsContainer-DXD_8rqh.js')}),
8171
+ .../* #__PURE__ */ Object.assign({"/widgets/EodashDatePicker.vue": () => import('./EodashDatePicker-BZeQ6bcu.js'),"/widgets/EodashItemCatalog/index.vue": () => import('./index-BoCcZ0l4.js'),"/widgets/EodashItemFilter.vue": () => import('./EodashItemFilter-CmZkk7GK.js'),"/widgets/EodashLayerControl.vue": () => import('./EodashLayerControl-D54fY-bX.js'),"/widgets/EodashLayoutSwitcher.vue": () => import('./EodashLayoutSwitcher-BCP3FvDb.js'),"/widgets/EodashMap/EodashMapBtns.vue": () => import('./EodashMapBtns-D-HulIl1.js'),"/widgets/EodashMap/index.vue": () => import('./index-BIcmbjr0.js'),"/widgets/EodashProcess/ProcessList.vue": () => import('./ProcessList-C9eAg2Sb.js').then(n => n.a),"/widgets/EodashProcess/index.vue": () => import('./index-BHilH1qx.js'),"/widgets/EodashStacInfo.vue": () => import('./EodashStacInfo-BZbmT8vT.js'),"/widgets/EodashTimeSlider.vue": () => import('./EodashTimeSlider-DIcAJr6D.js'),"/widgets/EodashTools.vue": () => import('./EodashTools-Cz6X6hsF.js'),"/widgets/ExportState.vue": () => import('./ExportState-DFVFAgKz.js'),"/widgets/PopUp.vue": () => import('./PopUp-DwI8V2gW.js'),"/widgets/WidgetsContainer.vue": () => import('./WidgetsContainer-D-VfMRxE.js')}),
8049
8172
  .../* #__PURE__ */ Object.assign({}),
8050
8173
  };
8051
8174
  for (const key in importMap) {
@@ -8171,7 +8294,7 @@ const getWidgetDefinition = (config) => {
8171
8294
 
8172
8295
  case "web-component":
8173
8296
  importedWidget.component = defineAsyncComponent({
8174
- loader: () => import('./DynamicWebComponent-CBsxC82P.js'),
8297
+ loader: () => import('./DynamicWebComponent-CoLO8FEf.js'),
8175
8298
  suspensible: true,
8176
8299
  });
8177
8300
  importedWidget.props = reactive(config.widget);
@@ -8568,7 +8691,7 @@ return (_ctx, _cache) => {
8568
8691
 
8569
8692
  };
8570
8693
 
8571
- const version = "5.3.3";
8694
+ const version = "5.4.0";
8572
8695
  const pkgJson = {
8573
8696
  version};
8574
8697
 
@@ -8678,15 +8801,15 @@ const { smAndDown } = useDisplay();
8678
8801
 
8679
8802
  const TemplateComponent = computed(() =>
8680
8803
  smAndDown.value
8681
- ? defineAsyncComponent(() => import('./MobileLayout-BfBeF-JF.js'))
8682
- : defineAsyncComponent(() => import('./DashboardLayout-Cp8Rv3Ef.js')),
8804
+ ? defineAsyncComponent(() => import('./MobileLayout-3Ko9XSfO.js'))
8805
+ : defineAsyncComponent(() => import('./DashboardLayout-CQOGHPW_.js')),
8683
8806
  );
8684
8807
 
8685
8808
  const HeaderComponent = defineAsyncComponent(
8686
- () => import('./Header-BBdi_-Lp.js'),
8809
+ () => import('./Header-_D9Z-zFJ.js'),
8687
8810
  );
8688
8811
  const FooterComponent = defineAsyncComponent(
8689
- () => import('./Footer-IQNyfd78.js'),
8812
+ () => import('./Footer-DLzQcjkI.js'),
8690
8813
  );
8691
8814
 
8692
8815
  const error = ref("");