@eodash/eodash 5.3.2 → 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.
- package/core/client/composables/DefineEodash.js +3 -1
- package/core/client/eodashSTAC/EodashCollection.js +29 -43
- package/core/client/eodashSTAC/auth.js +19 -15
- package/core/client/eodashSTAC/createLayers.js +318 -163
- package/core/client/eodashSTAC/helpers.js +64 -42
- package/core/client/eodashSTAC/parquet.js +1 -0
- package/core/client/eodashSTAC/triggers.js +7 -6
- package/core/client/store/states.js +1 -1
- package/core/client/types.ts +15 -9
- package/core/client/utils/states.js +32 -0
- package/dist/client/{DashboardLayout-BHQnHqWW.js → DashboardLayout-CQOGHPW_.js} +2 -2
- package/dist/client/{DynamicWebComponent-B4PdeZ9P.js → DynamicWebComponent-CoLO8FEf.js} +1 -1
- package/dist/client/{EodashDatePicker-Ch_AXVas.js → EodashDatePicker-BZeQ6bcu.js} +3 -3
- package/dist/client/{EodashItemFilter-lTuzCl08.js → EodashItemFilter-CmZkk7GK.js} +1 -1
- package/dist/client/{EodashLayerControl-CBSGRlIi.js → EodashLayerControl-D54fY-bX.js} +2 -2
- package/dist/client/{EodashLayoutSwitcher-DdwQYoI4.js → EodashLayoutSwitcher-BCP3FvDb.js} +3 -3
- package/dist/client/{EodashMapBtns-B910ylV6.js → EodashMapBtns-D-HulIl1.js} +14 -9
- package/dist/client/{EodashStacInfo-CeHGMZ8x.js → EodashStacInfo-BZbmT8vT.js} +1 -1
- package/dist/client/{EodashTimeSlider-BApJJK0u.js → EodashTimeSlider-DIcAJr6D.js} +2 -2
- package/dist/client/{EodashTools-CJVm0k-Q.js → EodashTools-Cz6X6hsF.js} +4 -4
- package/dist/client/{ExportState-NXzNGWYq.js → ExportState-DFVFAgKz.js} +4 -4
- package/dist/client/{Footer-DfXUC8IK.js → Footer-DLzQcjkI.js} +1 -1
- package/dist/client/{Header-BHgaNMEH.js → Header-_D9Z-zFJ.js} +2 -2
- package/dist/client/{MobileLayout-B77RzrNe.js → MobileLayout-3Ko9XSfO.js} +2 -2
- package/dist/client/{PopUp-BJwqRDNq.js → PopUp-DwI8V2gW.js} +2 -2
- package/dist/client/{ProcessList-BFvV4RvS.js → ProcessList-C9eAg2Sb.js} +20 -8
- package/dist/client/{VImg-RGGIQ_yA.js → VImg-COXTnCWE.js} +2 -2
- package/dist/client/{VMain-CniQR94B.js → VMain-C74l1bv-.js} +1 -1
- package/dist/client/{VTooltip-D5dnTfem.js → VTooltip-BLS-cQ9N.js} +2 -2
- package/dist/client/{WidgetsContainer-CvnR4J1T.js → WidgetsContainer-D-VfMRxE.js} +1 -1
- package/dist/client/{asWebComponent-Dptqds6-.js → asWebComponent-Bw03Jutr.js} +390 -220
- package/dist/client/{async-C1hb39Tc.js → async-D4G-FOIc.js} +13 -3
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-CiSZZEn2.js → forwardRefs-CRMFoNYN.js} +2 -2
- package/dist/client/{handling-CZ537GCL.js → handling-DTAhQuPh.js} +94 -10
- package/dist/client/{helpers-DoQGyrvY.js → helpers-CsjKHAcK.js} +72 -50
- package/dist/client/{index-4sC2BIcK.js → index-BHilH1qx.js} +17 -13
- package/dist/client/{index-wcTqj0PZ.js → index-BIcmbjr0.js} +55 -16
- package/dist/client/{index--uKz-mt4.js → index-BoCcZ0l4.js} +3 -3
- package/dist/client/{index-DTxo2ysK.js → index-DEmHaCL3.js} +2 -2
- package/dist/client/templates.js +6 -2
- package/dist/client/{transition-CFfv5MCB.js → transition-6MJLK-_H.js} +1 -1
- package/dist/types/core/client/composables/DefineEodash.d.ts +1 -1
- package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +28 -11
- package/dist/types/core/client/eodashSTAC/auth.d.ts +5 -5
- package/dist/types/core/client/eodashSTAC/createLayers.d.ts +30 -23
- package/dist/types/core/client/eodashSTAC/helpers.d.ts +19 -4
- package/dist/types/core/client/types.d.ts +2 -1
- package/dist/types/core/client/utils/states.d.ts +28 -0
- package/dist/types/templates/index.d.ts +1 -0
- package/dist/types/widgets/EodashMap/EodashMapBtns.vue.d.ts +2 -0
- package/dist/types/widgets/EodashMap/index.vue.d.ts +2 -0
- package/dist/types/widgets/EodashProcess/methods/handling.d.ts +13 -0
- package/dist/types/widgets/EodashProcess/methods/utils.d.ts +1 -0
- package/package.json +2 -2
- package/templates/expert.js +4 -0
- package/templates/index.js +2 -0
- package/widgets/EodashMap/EodashMapBtns.vue +15 -0
- package/widgets/EodashMap/index.vue +17 -4
- package/widgets/EodashMap/methods/create-layers-config.js +23 -0
- package/widgets/EodashMap/methods/index.js +9 -7
- package/widgets/EodashProcess/ProcessList.vue +10 -2
- package/widgets/EodashProcess/index.vue +1 -9
- package/widgets/EodashProcess/methods/composables.js +13 -1
- package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +15 -6
- package/widgets/EodashProcess/methods/handling.js +77 -0
- package/widgets/EodashProcess/methods/utils.js +10 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as useEmitLayersUpdate } from './asWebComponent-
|
|
1
|
+
import { s as getCompareLayers, q as getLayers, W as replaceLayer, b as extractLayerConfig, x as extractLayerLegend, m as mergeGeojsons, d as axios, X as axios$1, I as compareIndicator, G as indicator } from './helpers-CsjKHAcK.js';
|
|
2
|
+
import { P as useEmitLayersUpdate } from './asWebComponent-Bw03Jutr.js';
|
|
3
3
|
import { isMulti } from '@eox/jsonform/src/custom-inputs/spatial/utils';
|
|
4
4
|
import log from 'loglevel';
|
|
5
5
|
|
|
@@ -502,6 +502,16 @@ function extractAsyncResults(resultItem) {
|
|
|
502
502
|
}
|
|
503
503
|
return extracted;
|
|
504
504
|
}
|
|
505
|
+
|
|
506
|
+
/** @param {*} jsonformSchema */
|
|
507
|
+
const getDrawToolsProperty = (jsonformSchema) => {
|
|
508
|
+
for (const property in jsonformSchema.properties) {
|
|
509
|
+
if (jsonformSchema.properties[property]?.options?.drawtools) {
|
|
510
|
+
return property;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
|
|
505
515
|
/**
|
|
506
516
|
* @param {import("@eox/map").EOxMap | null} mapElement
|
|
507
517
|
* @param {import("@eox/map").EoxLayer[]} processLayers
|
|
@@ -801,4 +811,4 @@ const getJobStatusUrl = (jobID, indicator) => {
|
|
|
801
811
|
return jobUrl;
|
|
802
812
|
};
|
|
803
813
|
|
|
804
|
-
export { creatAsyncProcessLayerDefinitions as a,
|
|
814
|
+
export { creatAsyncProcessLayerDefinitions as a, getBboxProperty as b, createTiffLayerDefinition as c, download as d, extractAsyncResults as e, generateTimePairs as f, getDrawToolsProperty as g, updateJsonformSchemaTarget as h, extractGeometries as i, applyProcessLayersToMap as j, getJobStatusUrl as k, loadProcess as l, downloadPreviousResults as m, deleteJob as n, pollProcessStatus as p, separateEndpointLinks as s, updateJobsStatus as u };
|
package/dist/client/eo-dash.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { aI as EodashConstructor, aH as register, aJ as store } from './asWebComponent-
|
|
1
|
+
export { aI as EodashConstructor, aH as register, aJ as store } from './asWebComponent-Bw03Jutr.js';
|
|
2
2
|
import 'vue';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, watch, onScopeDispose, nextTick, ref, watchEffect, effectScope, inject, mergeProps, shallowRef, onMounted, toRef, reactive, provide, toValue, toRaw, readonly, warn, onBeforeUnmount, createElementVNode, Fragment, createVNode, Teleport, withDirectives, vShow, Transition } from 'vue';
|
|
2
|
-
import { ar as isOn, as as eventName, p as propsFactory, at as destructComputed, au as parseAnchor, av as flipSide, aw as flipAlign, ax as flipCorner, ay as CircularBuffer, az as deepEqual, X as consoleError, aA as getAxis, o as convertToUnit, v as clamp, ao as IN_BROWSER, y as useToggleScope, aB as defer, ak as getCurrentInstance, aC as templateRef, aD as matchesSelector, D as useDisplay, q as makeThemeProps, d as makeDimensionProps, e as makeComponentProps, g as genericComponent, x as useProxiedModel, k as provideTheme, l as useRtl, f as useBackgroundColor, b as useDimension, aE as useRouter, aF as useBackButton, an as standardEasing, c as useRender } from './asWebComponent-
|
|
3
|
-
import { m as makeTransitionProps, M as MaybeTransition } from './transition-
|
|
2
|
+
import { ar as isOn, as as eventName, p as propsFactory, at as destructComputed, au as parseAnchor, av as flipSide, aw as flipAlign, ax as flipCorner, ay as CircularBuffer, az as deepEqual, X as consoleError, aA as getAxis, o as convertToUnit, v as clamp, ao as IN_BROWSER, y as useToggleScope, aB as defer, ak as getCurrentInstance, aC as templateRef, aD as matchesSelector, D as useDisplay, q as makeThemeProps, d as makeDimensionProps, e as makeComponentProps, g as genericComponent, x as useProxiedModel, k as provideTheme, l as useRtl, f as useBackgroundColor, b as useDimension, aE as useRouter, aF as useBackButton, an as standardEasing, c as useRender } from './asWebComponent-Bw03Jutr.js';
|
|
3
|
+
import { m as makeTransitionProps, M as MaybeTransition } from './transition-6MJLK-_H.js';
|
|
4
4
|
|
|
5
5
|
class Box {
|
|
6
6
|
constructor(args) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import log from 'loglevel';
|
|
2
|
-
import { s as separateEndpointLinks, c as createTiffLayerDefinition, p as pollProcessStatus, e as extractAsyncResults, u as updateJobsStatus, a as creatAsyncProcessLayerDefinitions,
|
|
3
|
-
import {
|
|
2
|
+
import { s as separateEndpointLinks, c as createTiffLayerDefinition, p as pollProcessStatus, e as extractAsyncResults, u as updateJobsStatus, a as creatAsyncProcessLayerDefinitions, b as getBboxProperty, f as generateTimePairs, h as updateJsonformSchemaTarget, i as extractGeometries, j as applyProcessLayersToMap, g as getDrawToolsProperty } from './async-D4G-FOIc.js';
|
|
3
|
+
import { d as axios, b as extractLayerConfig, I as compareIndicator, G as indicator, y as extractCollectionUrls, H as currentCompareUrl, B as currentUrl, z as generateLinksFromItems, o as getDatetimeProperty, C as datetime, J as comparePoi, q as getLayers, D as poi } from './helpers-CsjKHAcK.js';
|
|
4
4
|
import mustache from 'mustache';
|
|
5
|
-
import { Q as isFirstLoad, E as useSTAcStore, S as readParquetItems, T as useGetSubCodeId } from './asWebComponent-
|
|
5
|
+
import { Q as isFirstLoad, E as useSTAcStore, S as readParquetItems, T as useGetSubCodeId } from './asWebComponent-Bw03Jutr.js';
|
|
6
6
|
import { toAbsolute } from 'stac-js/src/http.js';
|
|
7
7
|
|
|
8
8
|
////// --- CHARTS --- //////
|
|
@@ -797,7 +797,7 @@ async function handleVedaEndpoint({
|
|
|
797
797
|
enableCompare = false,
|
|
798
798
|
}) {
|
|
799
799
|
const vedaLink = links.find(
|
|
800
|
-
(link) => link.rel === "service" && link.endpoint === "veda",
|
|
800
|
+
(link) => link.rel === "service" && (link.endpoint === "veda" || link.endpoint === "veda_stac"),
|
|
801
801
|
);
|
|
802
802
|
if (!vedaLink) {
|
|
803
803
|
return;
|
|
@@ -810,12 +810,17 @@ async function handleVedaEndpoint({
|
|
|
810
810
|
const configs = await fetchVedaCOGsConfig(
|
|
811
811
|
selectedStac,
|
|
812
812
|
enableCompare ? currentCompareUrl.value : currentUrl.value,
|
|
813
|
+
vedaLink,
|
|
813
814
|
);
|
|
814
815
|
// TODO: convert jsonform bbox type to geojson in the schema to avoid the conversion here
|
|
815
816
|
return await Promise.all(
|
|
816
817
|
configs.map(({ endpoint, datetime }) => {
|
|
818
|
+
const url = new URL(vedaEndpoint);
|
|
819
|
+
const key = vedaLink.endpoint === "veda_stac" ? "ids" : "url";
|
|
820
|
+
url.searchParams.set(key, endpoint);
|
|
821
|
+
|
|
817
822
|
return axios
|
|
818
|
-
.post(
|
|
823
|
+
.post(url.toString(), {
|
|
819
824
|
...{
|
|
820
825
|
type: "Feature",
|
|
821
826
|
properties: {},
|
|
@@ -841,8 +846,9 @@ async function handleVedaEndpoint({
|
|
|
841
846
|
* Fetches the COGs endpoints from the STAC collections
|
|
842
847
|
* @param {import("stac-ts").StacCollection} selectedStac
|
|
843
848
|
* @param {string} absoluteUrl
|
|
849
|
+
* @param {import("stac-ts").StacLink} vedaLink
|
|
844
850
|
*/
|
|
845
|
-
async function fetchVedaCOGsConfig(selectedStac, absoluteUrl) {
|
|
851
|
+
async function fetchVedaCOGsConfig(selectedStac, absoluteUrl, vedaLink) {
|
|
846
852
|
// retrieve the collections from the indicator
|
|
847
853
|
const collectionLinks = selectedStac.links.filter(
|
|
848
854
|
(link) => link.rel == "child",
|
|
@@ -888,10 +894,13 @@ async function fetchVedaCOGsConfig(selectedStac, absoluteUrl) {
|
|
|
888
894
|
);
|
|
889
895
|
const itemLinks = collection.links.filter((link) => link.rel == "item");
|
|
890
896
|
configs.push(
|
|
891
|
-
...itemLinks.map((link) =>
|
|
892
|
-
endpoint
|
|
897
|
+
...itemLinks.map((link) => {
|
|
898
|
+
const endpoint = /** @type {string} */ (vedaLink.endpoint === "veda_stac" ? link.id : link["cog_href"]);
|
|
899
|
+
return {
|
|
900
|
+
endpoint,
|
|
893
901
|
datetime: /** @type string **/ (link[datetimeProperty]),
|
|
894
|
-
}
|
|
902
|
+
}
|
|
903
|
+
})
|
|
895
904
|
);
|
|
896
905
|
}
|
|
897
906
|
|
|
@@ -998,6 +1007,13 @@ async function initProcess({
|
|
|
998
1007
|
|
|
999
1008
|
await jsonformEl.value?.editor.destroy();
|
|
1000
1009
|
if (updatedJsonform) {
|
|
1010
|
+
// make sure correct target layer id is used in jsonform
|
|
1011
|
+
if (updatedJsonform.properties?.feature?.options?.drawtools?.layerId) {
|
|
1012
|
+
await updateJsonformIdentifier({
|
|
1013
|
+
jsonformSchema,
|
|
1014
|
+
newLayers: await getLayers(),
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1001
1017
|
if (enableCompare) {
|
|
1002
1018
|
updatedJsonform = updateJsonformSchemaTarget(updatedJsonform);
|
|
1003
1019
|
}
|
|
@@ -1005,6 +1021,74 @@ async function initProcess({
|
|
|
1005
1021
|
}
|
|
1006
1022
|
}
|
|
1007
1023
|
|
|
1024
|
+
/**
|
|
1025
|
+
* Update the jsonform schema to have the correct layer id from the map
|
|
1026
|
+
*
|
|
1027
|
+
* @export
|
|
1028
|
+
* @async
|
|
1029
|
+
* @param {Object} params
|
|
1030
|
+
* @param {import("vue").Ref<Record<string,any> | null>} params.jsonformSchema params.jsonformSchema
|
|
1031
|
+
* @param {Record<string, any>[] | undefined} params.newLayers params.newLayers
|
|
1032
|
+
*/
|
|
1033
|
+
async function updateJsonformIdentifier({ jsonformSchema, newLayers }) {
|
|
1034
|
+
const form = jsonformSchema.value;
|
|
1035
|
+
if (!form) {
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
const drawToolsProperty = getDrawToolsProperty(form);
|
|
1039
|
+
if (
|
|
1040
|
+
drawToolsProperty &&
|
|
1041
|
+
newLayers &&
|
|
1042
|
+
form?.properties[drawToolsProperty]?.options?.drawtools?.layerId
|
|
1043
|
+
) {
|
|
1044
|
+
// get partial or full id and try to match with correct eoxmap layer
|
|
1045
|
+
// check if newLayers is an array or an object with layers property
|
|
1046
|
+
let layers = newLayers;
|
|
1047
|
+
// @ts-expect-error TODO payload coming from time update sometimes is not an object with layers property
|
|
1048
|
+
if (newLayers.layers && Array.isArray(newLayers.layers)) {
|
|
1049
|
+
// @ts-expect-error TODO payload coming from time update sometimes is not an object with layers property
|
|
1050
|
+
layers = newLayers.layers;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
const layerId =
|
|
1054
|
+
form.properties[drawToolsProperty].options.drawtools.layerId.split(
|
|
1055
|
+
";:;",
|
|
1056
|
+
)[0];
|
|
1057
|
+
let matchedLayerId = null;
|
|
1058
|
+
// layers are not flat can be grouped, we need to recursively search
|
|
1059
|
+
const traverseLayers = (
|
|
1060
|
+
/** @type {Record<string, any>[] | undefined} */ layersArray,
|
|
1061
|
+
) => {
|
|
1062
|
+
if (!layersArray) {
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
for (const layer of layersArray) {
|
|
1066
|
+
if (layer.layers) {
|
|
1067
|
+
// @ts-expect-error TODO payload coming from time update events is not an object with layers property
|
|
1068
|
+
traverseLayers(layer);
|
|
1069
|
+
} else {
|
|
1070
|
+
if (layer.properties?.id?.startsWith(layerId)) {
|
|
1071
|
+
matchedLayerId = layer.properties.id;
|
|
1072
|
+
break;
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
};
|
|
1077
|
+
traverseLayers(layers);
|
|
1078
|
+
if (matchedLayerId) {
|
|
1079
|
+
form.properties.feature.options.drawtools.layerId = matchedLayerId;
|
|
1080
|
+
// trigger jsonform update in next tick
|
|
1081
|
+
jsonformSchema.value = null;
|
|
1082
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1083
|
+
jsonformSchema.value = form;
|
|
1084
|
+
} else {
|
|
1085
|
+
throw new Error(
|
|
1086
|
+
`Could not find matching layer for processing form with id: ${layerId}`,
|
|
1087
|
+
);
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1008
1092
|
/**
|
|
1009
1093
|
*
|
|
1010
1094
|
* @param {object} params
|
|
@@ -1230,4 +1314,4 @@ const loadPOiIndicator = () => {
|
|
|
1230
1314
|
}
|
|
1231
1315
|
};
|
|
1232
1316
|
|
|
1233
|
-
export { handleProcesses as h, initProcess as i, loadPOiIndicator as l, onChartClick as o };
|
|
1317
|
+
export { handleProcesses as h, initProcess as i, loadPOiIndicator as l, onChartClick as o, updateJsonformIdentifier as u };
|
|
@@ -3838,7 +3838,7 @@ const currentUrl = ref("");
|
|
|
3838
3838
|
const currentCompareUrl = ref("");
|
|
3839
3839
|
|
|
3840
3840
|
/** Currently selected datetime */
|
|
3841
|
-
const datetime = ref(
|
|
3841
|
+
const datetime = ref("");
|
|
3842
3842
|
|
|
3843
3843
|
/** Currently selected indicator */
|
|
3844
3844
|
const indicator = ref("");
|
|
@@ -4073,25 +4073,25 @@ function getStyleVariablesState(collectionId, variables) {
|
|
|
4073
4073
|
"",
|
|
4074
4074
|
"",
|
|
4075
4075
|
];
|
|
4076
|
-
return
|
|
4077
|
-
collection === collectionId &&
|
|
4078
|
-
["Vector", "WebGLTile", "VectorTile"].includes(layer?.type ?? "")
|
|
4079
|
-
);
|
|
4076
|
+
return collection === collectionId;
|
|
4080
4077
|
});
|
|
4081
4078
|
|
|
4082
4079
|
if (!matchingLayer) {
|
|
4083
4080
|
return variables;
|
|
4084
4081
|
}
|
|
4082
|
+
// TODO instead tap into store for changed variables state per layer
|
|
4083
|
+
// because XYZ and WMTS use tileurlfunction update, where we can not retrieve
|
|
4084
|
+
// current values from OL layers anyhow
|
|
4085
4085
|
|
|
4086
4086
|
const olLayer = mapElement.getLayerById(matchingLayer.properties?.id ?? "");
|
|
4087
|
-
|
|
4087
|
+
let oldVariablesState =
|
|
4088
4088
|
/** @type {import("ol/layer").Vector} */ (
|
|
4089
4089
|
olLayer
|
|
4090
4090
|
//@ts-expect-error variables doesn't exist in non-flat style
|
|
4091
4091
|
).getStyle?.()?.variables ??
|
|
4092
4092
|
//@ts-expect-error (styleVariables_ is a private property)
|
|
4093
4093
|
/** @type {import("ol/layer").WebGLTile} */ (olLayer).styleVariables_;
|
|
4094
|
-
|
|
4094
|
+
|
|
4095
4095
|
if (!oldVariablesState) {
|
|
4096
4096
|
return variables;
|
|
4097
4097
|
}
|
|
@@ -4145,13 +4145,14 @@ function generateFeatures(links, extraProperties = {}, rel = "item") {
|
|
|
4145
4145
|
}
|
|
4146
4146
|
|
|
4147
4147
|
/**
|
|
4148
|
-
*
|
|
4148
|
+
* Spearates and extracts layerConfig (jsonform schema & legend) from a style json
|
|
4149
4149
|
*
|
|
4150
4150
|
* @param {string} collectionId
|
|
4151
4151
|
* @param { import("@/types").EodashStyleJson} [style]
|
|
4152
4152
|
* @param {Record<string,any>} [rasterJsonform]
|
|
4153
|
+
* @param {string} [layerConfigType]
|
|
4153
4154
|
* */
|
|
4154
|
-
function extractLayerConfig(collectionId, style, rasterJsonform) {
|
|
4155
|
+
function extractLayerConfig(collectionId, style, rasterJsonform, layerConfigType) {
|
|
4155
4156
|
if (!style && !rasterJsonform) {
|
|
4156
4157
|
return { layerConfig: undefined, style: undefined };
|
|
4157
4158
|
}
|
|
@@ -4159,6 +4160,10 @@ function extractLayerConfig(collectionId, style, rasterJsonform) {
|
|
|
4159
4160
|
style = { ...style };
|
|
4160
4161
|
}
|
|
4161
4162
|
|
|
4163
|
+
if (style?.variables && Object.keys(style.variables ?? {}).length) {
|
|
4164
|
+
style.variables = getStyleVariablesState(collectionId, style.variables);
|
|
4165
|
+
}
|
|
4166
|
+
|
|
4162
4167
|
if (rasterJsonform) {
|
|
4163
4168
|
return {
|
|
4164
4169
|
layerConfig: {
|
|
@@ -4170,16 +4175,12 @@ function extractLayerConfig(collectionId, style, rasterJsonform) {
|
|
|
4170
4175
|
};
|
|
4171
4176
|
}
|
|
4172
4177
|
|
|
4173
|
-
if (style?.variables && Object.keys(style.variables ?? {}).length) {
|
|
4174
|
-
style.variables = getStyleVariablesState(collectionId, style.variables);
|
|
4175
|
-
}
|
|
4176
|
-
|
|
4177
4178
|
/** @type {Record<string,unknown> | undefined} */
|
|
4178
4179
|
let layerConfig = undefined;
|
|
4179
4180
|
|
|
4180
4181
|
if (style?.jsonform) {
|
|
4181
4182
|
// this explicitly sets legend only if jsonform is configured
|
|
4182
|
-
layerConfig = { schema: style.jsonform, type: "style" };
|
|
4183
|
+
layerConfig = { schema: style.jsonform, type: layerConfigType || "style" };
|
|
4183
4184
|
delete style.jsonform;
|
|
4184
4185
|
if (style?.legend) {
|
|
4185
4186
|
layerConfig.legend = style.legend;
|
|
@@ -4193,6 +4194,7 @@ function extractLayerConfig(collectionId, style, rasterJsonform) {
|
|
|
4193
4194
|
|
|
4194
4195
|
return { layerConfig, style };
|
|
4195
4196
|
}
|
|
4197
|
+
|
|
4196
4198
|
/**
|
|
4197
4199
|
*
|
|
4198
4200
|
* @param {number[]} bbox
|
|
@@ -4267,28 +4269,38 @@ const extractRoles = (properties, linkOrAsset) => {
|
|
|
4267
4269
|
|
|
4268
4270
|
/**
|
|
4269
4271
|
* Extracts a single non-link style JSON from a STAC Item optionally for a selected key mapping
|
|
4270
|
-
* @param {import("stac-ts").StacItem}
|
|
4271
|
-
* @param {string}
|
|
4272
|
-
* @param {string | undefined}
|
|
4273
|
-
* @returns
|
|
4272
|
+
* @param { import("stac-ts").StacItem | import("stac-ts").StacCollection } stacObject
|
|
4273
|
+
* @param {string | undefined} linkKey
|
|
4274
|
+
* @param {string | undefined} assetKey
|
|
4275
|
+
* @returns
|
|
4274
4276
|
**/
|
|
4275
|
-
const fetchStyle = async (
|
|
4277
|
+
const fetchStyle = async (
|
|
4278
|
+
stacObject,
|
|
4279
|
+
linkKey = undefined,
|
|
4280
|
+
assetKey = undefined,
|
|
4281
|
+
) => {
|
|
4276
4282
|
let styleLink = null;
|
|
4277
|
-
if (
|
|
4278
|
-
styleLink =
|
|
4283
|
+
if (linkKey) {
|
|
4284
|
+
styleLink = stacObject.links.find(
|
|
4285
|
+
(link) =>
|
|
4286
|
+
link.rel.includes("style") &&
|
|
4287
|
+
link["links:keys"] &&
|
|
4288
|
+
/** @type {Array<string>} */ (link["links:keys"]).includes(linkKey),
|
|
4289
|
+
);
|
|
4290
|
+
} else if (assetKey) {
|
|
4291
|
+
styleLink = stacObject.links.find(
|
|
4292
|
+
(link) =>
|
|
4293
|
+
link.rel.includes("style") &&
|
|
4294
|
+
link["asset:keys"] &&
|
|
4295
|
+
/** @type {Array<string>} */ (link["asset:keys"]).includes(assetKey),
|
|
4296
|
+
);
|
|
4279
4297
|
} else {
|
|
4280
|
-
|
|
4298
|
+
log.debug("Neither link key, nor asset key input, can not match any style to layer.", stacObject.id);
|
|
4299
|
+
return {};
|
|
4281
4300
|
}
|
|
4282
4301
|
if (styleLink) {
|
|
4283
|
-
let url = "";
|
|
4284
|
-
if (styleLink.href.startsWith("http")) {
|
|
4285
|
-
url = styleLink.href;
|
|
4286
|
-
} else {
|
|
4287
|
-
url = toAbsolute(styleLink.href, itemUrl);
|
|
4288
|
-
}
|
|
4289
|
-
|
|
4290
4302
|
/** @type {import("@/types").EodashStyleJson} */
|
|
4291
|
-
const styleJson = await axios.get(
|
|
4303
|
+
const styleJson = await axios.get(styleLink.href).then((resp) => resp.data);
|
|
4292
4304
|
|
|
4293
4305
|
log.debug("fetched styles JSON", JSON.parse(JSON.stringify(styleJson)));
|
|
4294
4306
|
return { ...styleJson };
|
|
@@ -4297,18 +4309,15 @@ const fetchStyle = async (item, itemUrl, key=undefined) => {
|
|
|
4297
4309
|
|
|
4298
4310
|
/**
|
|
4299
4311
|
* Fetches all style JSONs from a STAC Item and returns an array with style objects
|
|
4300
|
-
* @param {import("stac-ts").StacItem}
|
|
4301
|
-
* @param {string} itemUrl
|
|
4312
|
+
* @param {import("stac-ts").StacItem | import("stac-ts").StacCollection} stacObject
|
|
4302
4313
|
* @returns { Promise <Array<import("@/types").EodashStyleJson>>}
|
|
4303
4314
|
**/
|
|
4304
|
-
const fetchAllStyles = async (
|
|
4305
|
-
const styleLinks =
|
|
4315
|
+
const fetchAllStyles = async (stacObject) => {
|
|
4316
|
+
const styleLinks = stacObject.links.filter((link) =>
|
|
4317
|
+
link.rel.includes("style"),
|
|
4318
|
+
);
|
|
4306
4319
|
const fetchPromises = styleLinks.map(async (link) => {
|
|
4307
|
-
|
|
4308
|
-
? link.href
|
|
4309
|
-
: toAbsolute(link.href, itemUrl);
|
|
4310
|
-
|
|
4311
|
-
const styleJson = await axios.get(url).then((resp) => resp.data);
|
|
4320
|
+
const styleJson = await axios.get(link.href).then((resp) => resp.data);
|
|
4312
4321
|
log.debug("fetched styles JSON", JSON.parse(JSON.stringify(styleJson)));
|
|
4313
4322
|
return styleJson;
|
|
4314
4323
|
});
|
|
@@ -4424,12 +4433,11 @@ const extractLayerTimeValues = (items, currentStep) => {
|
|
|
4424
4433
|
};
|
|
4425
4434
|
};
|
|
4426
4435
|
|
|
4427
|
-
|
|
4428
4436
|
/**
|
|
4429
4437
|
* Recursively find all layers whose ID up to the first ; is same as given layer
|
|
4430
4438
|
*
|
|
4431
4439
|
* @param {import("@eox/map").EoxLayer[]} layers
|
|
4432
|
-
* @param {import("@eox/map").EoxLayer | undefined} referenceLayer - layer
|
|
4440
|
+
* @param {import("@eox/map").EoxLayer | undefined} referenceLayer - layer
|
|
4433
4441
|
* @returns {import("@eox/map").EoxLayer[]} Matching layer objects.
|
|
4434
4442
|
*/
|
|
4435
4443
|
const findLayersByLayerPrefix = (layers, referenceLayer) => {
|
|
@@ -4493,7 +4501,11 @@ const replaceLayersInStructure = (layers, toRemove, toInsert) => {
|
|
|
4493
4501
|
for (const layer of layers) {
|
|
4494
4502
|
if (layer.type === "Group" && Array.isArray(layer.layers)) {
|
|
4495
4503
|
// Recurse into group layers
|
|
4496
|
-
const newGroupLayers = replaceLayersInStructure(
|
|
4504
|
+
const newGroupLayers = replaceLayersInStructure(
|
|
4505
|
+
layer.layers,
|
|
4506
|
+
toRemove,
|
|
4507
|
+
toInsert,
|
|
4508
|
+
);
|
|
4497
4509
|
result.push({ ...layer, layers: newGroupLayers });
|
|
4498
4510
|
continue;
|
|
4499
4511
|
}
|
|
@@ -4521,7 +4533,6 @@ const replaceLayersInStructure = (layers, toRemove, toInsert) => {
|
|
|
4521
4533
|
return result;
|
|
4522
4534
|
};
|
|
4523
4535
|
|
|
4524
|
-
|
|
4525
4536
|
/**
|
|
4526
4537
|
* Removes the layer with the id provided and injects an array of layers in its position
|
|
4527
4538
|
* @param {import("@eox/map").EoxLayer[]} currentLayers
|
|
@@ -4562,15 +4573,11 @@ const replaceLayer = (currentLayers, oldLayer, newLayers) => {
|
|
|
4562
4573
|
* @param {import('ol/layer').Layer} layer
|
|
4563
4574
|
*/
|
|
4564
4575
|
const getColFromLayer = async (indicators, layer) => {
|
|
4565
|
-
const [collectionId
|
|
4576
|
+
const [collectionId] = layer.get("id").split(";:;");
|
|
4566
4577
|
|
|
4567
4578
|
for (const ind of indicators) {
|
|
4568
4579
|
if (ind.collectionStac?.id !== collectionId) continue;
|
|
4569
|
-
|
|
4570
|
-
const itemIds = items?.map(item => item.id || item.datetime) ?? [];
|
|
4571
|
-
if (itemIds.includes(itemId)) {
|
|
4572
|
-
return ind;
|
|
4573
|
-
}
|
|
4580
|
+
return ind;
|
|
4574
4581
|
}
|
|
4575
4582
|
};
|
|
4576
4583
|
|
|
@@ -4917,4 +4924,19 @@ function extractLayerLegend(collection) {
|
|
|
4917
4924
|
return extraProperties;
|
|
4918
4925
|
}
|
|
4919
4926
|
|
|
4920
|
-
|
|
4927
|
+
|
|
4928
|
+
/**
|
|
4929
|
+
* @param { import ("stac-ts").StacLink } link
|
|
4930
|
+
* @returns {object}
|
|
4931
|
+
*/
|
|
4932
|
+
function extractEoxLegendLink(link) {
|
|
4933
|
+
let extraProperties = {};
|
|
4934
|
+
if (link["eox:colorlegend"]) {
|
|
4935
|
+
extraProperties = {
|
|
4936
|
+
layerLegend: link["eox:colorlegend"],
|
|
4937
|
+
};
|
|
4938
|
+
}
|
|
4939
|
+
return extraProperties;
|
|
4940
|
+
}
|
|
4941
|
+
|
|
4942
|
+
export { revokeCollectionBlobUrls as A, currentUrl as B, datetime as C, poi as D, activeTemplate as E, mapPosition as F, indicator as G, currentCompareUrl as H, compareIndicator as I, comparePoi as J, states as K, actions as L, includesProcess as M, sanitizeBbox as N, mapCompareEl as O, getColFromLayer as P, setMapProjFromCol as Q, availableMapProjection as R, changeMapProjection as S, setActiveTemplate as T, compareChartEl as U, chartEl as V, replaceLayer as W, axios$1 as X, removeUnneededProperties as Y, getChartSpec as Z, extractEoxLegendLink as a, extractLayerConfig as b, createLayerID as c, axios as d, extractRoles as e, fetchStyle as f, getProjectionCode as g, addTooltipInteraction as h, createAssetID as i, mapEl as j, isSTACItem as k, extractLayerTimeValues as l, mergeGeojsons as m, fetchApiItems as n, getDatetimeProperty as o, fetchAllStyles as p, getLayers as q, registerProjection as r, getCompareLayers as s, findLayer as t, findLayersByLayerPrefix as u, replaceLayersInStructure as v, generateFeatures as w, extractLayerLegend as x, extractCollectionUrls as y, generateLinksFromItems as z };
|
|
@@ -2,13 +2,13 @@ import { onMounted, watch, nextTick, ref, useTemplateRef, computed, createElemen
|
|
|
2
2
|
import '@eox/chart';
|
|
3
3
|
import '@eox/drawtools';
|
|
4
4
|
import '@eox/jsonform';
|
|
5
|
-
import { R as eoxLayersKey, K as useOnLayersUpdate, _ as _export_sfc, E as useSTAcStore, G as VBtn } from './asWebComponent-
|
|
5
|
+
import { R as eoxLayersKey, K as useOnLayersUpdate, _ as _export_sfc, E as useSTAcStore, G as VBtn } from './asWebComponent-Bw03Jutr.js';
|
|
6
6
|
import { storeToRefs } from 'pinia';
|
|
7
|
-
import { P as ProcessList, c as compareJobs, j as jobs } from './ProcessList-
|
|
8
|
-
import { i as initProcess, o as onChartClick, h as handleProcesses } from './handling-
|
|
7
|
+
import { P as ProcessList, c as compareJobs, j as jobs } from './ProcessList-C9eAg2Sb.js';
|
|
8
|
+
import { i as initProcess, u as updateJsonformIdentifier, o as onChartClick, h as handleProcesses } from './handling-DTAhQuPh.js';
|
|
9
9
|
import { useEventBus } from '@vueuse/core';
|
|
10
|
-
import { u as updateJobsStatus, d as download } from './async-
|
|
11
|
-
import {
|
|
10
|
+
import { u as updateJobsStatus, d as download, g as getDrawToolsProperty } from './async-D4G-FOIc.js';
|
|
11
|
+
import { I as compareIndicator, G as indicator, O as mapCompareEl, j as mapEl, U as compareChartEl, V as chartEl } from './helpers-CsjKHAcK.js';
|
|
12
12
|
import { mdiCogPlayOutline, mdiDownloadCircleOutline } from '@mdi/js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -74,6 +74,18 @@ const useInitProcess = ({
|
|
|
74
74
|
const evtKey =
|
|
75
75
|
mapElement?.id === "compare" ? "compareLayers:updated" : "layers:updated";
|
|
76
76
|
useOnLayersUpdate(async (evt, _payload) => {
|
|
77
|
+
if (
|
|
78
|
+
evt == "layertime:updated" ||
|
|
79
|
+
evt == "compareLayertime:updated" ||
|
|
80
|
+
evt == "time:updated" ||
|
|
81
|
+
evt == "compareTime:updated"
|
|
82
|
+
) {
|
|
83
|
+
await updateJsonformIdentifier({
|
|
84
|
+
jsonformSchema,
|
|
85
|
+
// @ts-expect-error TODO payload coming from time update events is not an object with layers property
|
|
86
|
+
newLayers: _payload,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
77
89
|
if (evt !== evtKey) {
|
|
78
90
|
return;
|
|
79
91
|
}
|
|
@@ -250,14 +262,6 @@ const downloadResults = () => {
|
|
|
250
262
|
};
|
|
251
263
|
|
|
252
264
|
const startProcess = async () => {
|
|
253
|
-
/** @param {*} jsonformSchema */
|
|
254
|
-
const getDrawToolsProperty = (jsonformSchema) => {
|
|
255
|
-
for (const property in jsonformSchema.properties) {
|
|
256
|
-
if (jsonformSchema.properties[property]?.options?.drawtools) {
|
|
257
|
-
return property;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
265
|
const drawToolsProperty = getDrawToolsProperty(jsonformSchema.value);
|
|
262
266
|
const propertyIsEmpty =
|
|
263
267
|
drawToolsProperty &&
|