@eodash/eodash 5.0.0-processing → 5.0.0-rc.1
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/asWebComponent.js +2 -3
- package/core/client/components/DashboardLayout.vue +35 -17
- package/core/client/components/Loading.vue +6 -9
- package/core/client/components/MobileLayout.vue +16 -14
- package/core/client/composables/DefineEodash.js +13 -3
- package/core/client/composables/DefineTemplate.js +67 -0
- package/core/client/composables/DefineWidgets.js +3 -2
- package/core/client/composables/EodashMap.js +23 -12
- package/core/client/composables/EodashProcess.js +10 -11
- package/core/client/composables/index.js +35 -10
- package/core/client/eodash.js +381 -139
- package/core/client/{utils/eodashSTAC.js → eodashSTAC/EodashCollection.js} +75 -42
- package/core/client/{utils → eodashSTAC}/createLayers.js +10 -8
- package/core/client/{utils → eodashSTAC}/helpers.js +45 -68
- package/core/client/eodashSTAC/triggers.js +43 -0
- package/core/client/plugins/vuetify.js +2 -1
- package/core/client/store/{Actions.js → actions.js} +16 -2
- package/core/client/store/index.js +4 -18
- package/core/client/store/stac.js +4 -4
- package/core/client/store/{States.js → states.js} +2 -0
- package/{dist/types/core/client/types.d.ts → core/client/types.ts} +47 -8
- package/core/client/utils/states.js +8 -3
- package/core/client/views/Dashboard.vue +6 -4
- package/core/client/vite-env.d.ts +1 -1
- package/dist/client/{DashboardLayout-CVMJ4l8M.js → DashboardLayout-FS5inBIm.js} +12 -15
- package/dist/client/{DynamicWebComponent-Cv8n457T.js → DynamicWebComponent-CBSgT677.js} +1 -1
- package/dist/client/{EodashDatePicker-VVkiPmpc.js → EodashDatePicker-BGSS2ZYK.js} +75 -163
- package/dist/client/EodashItemFilter-CFNKjm_Z.js +151 -0
- package/dist/client/{EodashLayerControl-53WghA8G.js → EodashLayerControl-CzffoPUs.js} +17 -7
- package/dist/client/EodashLayoutSwitcher-DM0zDhvI.js +52 -0
- package/dist/client/{EodashMap-CQnOePpy.js → EodashMap-BdFZ657e.js} +101 -38
- package/dist/client/EodashMapBtns-rC_IPD-Z.js +107 -0
- package/dist/client/EodashProcess-SLsTISKV.js +714 -0
- package/dist/client/EodashStacInfo-DFD0gtWm.js +85 -0
- package/dist/client/EodashTools-ImohD2ys.js +103 -0
- package/dist/client/{ExportState-BT8MLAW7.js → ExportState-LNZAovzM.js} +13 -13
- package/dist/client/{Footer-C6GUG84G.js → Footer-c19dV1ZR.js} +1 -1
- package/dist/client/{Header-D2dtCWp8.js → Header-CcvXFqqt.js} +3 -3
- package/dist/client/{MobileLayout-BAo8Wr8T.js → MobileLayout-OM6Wc-vj.js} +28 -31
- package/dist/client/{PopUp-Bm01q7Ko.js → PopUp-B0_c0207.js} +29 -8
- package/dist/client/{VImg-B8AbetCE.js → VImg-BpDhCbL0.js} +2 -2
- package/dist/client/{VMain-DnGlQUyr.js → VMain-DC05bDwX.js} +1 -1
- package/dist/client/{VOverlay-B8Qj7LRG.js → VOverlay-C7EUyVe_.js} +3 -3
- package/dist/client/VTooltip-C78suika.js +86 -0
- package/dist/client/{WidgetsContainer-CwXRRLS1.js → WidgetsContainer-sD1vDnhF.js} +1 -1
- package/dist/client/{asWebComponent-DUUoR7MZ.js → asWebComponent-D8bMMCEr.js} +1374 -1052
- package/dist/client/{style.css → eo-dash.css} +1 -1
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-CZJhEAKW.js → forwardRefs-yw6tFXER.js} +1 -1
- package/dist/client/{index-DlIO7sJ3.js → index-CpK_Yaom.js} +1 -1
- package/dist/client/{transition-BiR8wMn1.js → transition-B2YwqAYJ.js} +1 -1
- package/dist/node/cli.js +2 -2
- package/package.json +48 -37
- package/widgets/EodashDatePicker.vue +68 -54
- package/widgets/EodashItemFilter.vue +60 -105
- package/widgets/EodashLayerControl.vue +17 -4
- package/widgets/EodashLayoutSwitcher.vue +36 -0
- package/widgets/EodashMap.vue +26 -27
- package/widgets/EodashMapBtns.vue +41 -4
- package/widgets/EodashProcess.vue +4 -12
- package/widgets/EodashStacInfo.vue +82 -0
- package/widgets/EodashTools.vue +83 -0
- package/widgets/ExportState.vue +12 -12
- package/widgets/PopUp.vue +24 -2
- package/core/client/asWebComponent.d.ts +0 -23
- package/core/client/types.d.ts +0 -279
- package/dist/client/EodashItemFilter-CugWNQ86.js +0 -194
- package/dist/client/EodashMapBtns-uaRwFtfB.js +0 -66
- package/dist/client/EodashProcess-cF0unIy8.js +0 -1477
- package/dist/types/core/client/App.vue.d.ts +0 -7
- package/dist/types/core/client/asWebComponent.d.ts +0 -9
- package/dist/types/core/client/components/DashboardLayout.vue.d.ts +0 -2
- package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +0 -18
- package/dist/types/core/client/components/ErrorAlert.vue.d.ts +0 -2
- package/dist/types/core/client/components/Footer.vue.d.ts +0 -2
- package/dist/types/core/client/components/Header.vue.d.ts +0 -2
- package/dist/types/core/client/components/IframeWrapper.vue.d.ts +0 -7
- package/dist/types/core/client/components/Loading.vue.d.ts +0 -2
- package/dist/types/core/client/components/MobileLayout.vue.d.ts +0 -2
- package/dist/types/core/client/composables/DefineEodash.d.ts +0 -2
- package/dist/types/core/client/composables/DefineTemplate.d.ts +0 -15
- package/dist/types/core/client/composables/DefineWidgets.d.ts +0 -14
- package/dist/types/core/client/composables/EodashMap.d.ts +0 -5
- package/dist/types/core/client/composables/index.d.ts +0 -30
- package/dist/types/core/client/eodash.d.ts +0 -8
- package/dist/types/core/client/main.d.ts +0 -2
- package/dist/types/core/client/plugins/axios.d.ts +0 -2
- package/dist/types/core/client/plugins/index.d.ts +0 -3
- package/dist/types/core/client/plugins/vuetify.d.ts +0 -82
- package/dist/types/core/client/render.d.ts +0 -1
- package/dist/types/core/client/store/Actions.d.ts +0 -12
- package/dist/types/core/client/store/States.d.ts +0 -22
- package/dist/types/core/client/store/index.d.ts +0 -2
- package/dist/types/core/client/store/stac.d.ts +0 -25
- package/dist/types/core/client/utils/createLayers.d.ts +0 -45
- package/dist/types/core/client/utils/eodashSTAC.d.ts +0 -82
- package/dist/types/core/client/utils/helpers.d.ts +0 -84
- package/dist/types/core/client/utils/index.d.ts +0 -2
- package/dist/types/core/client/utils/keys.d.ts +0 -6
- package/dist/types/core/client/utils/states.d.ts +0 -14
- package/dist/types/core/client/views/Dashboard.vue.d.ts +0 -9
- package/dist/types/widgets/EodashDatePicker.vue.d.ts +0 -7
- package/dist/types/widgets/EodashItemFilter.vue.d.ts +0 -42
- package/dist/types/widgets/EodashLayerControl.vue.d.ts +0 -11
- package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +0 -9
- package/dist/types/widgets/EodashMap.vue.d.ts +0 -7
- package/dist/types/widgets/EodashMapBtns.vue.d.ts +0 -11
- package/dist/types/widgets/EodashStacInfo.vue.d.ts +0 -21
- package/dist/types/widgets/EodashTools.vue.d.ts +0 -15
- package/dist/types/widgets/ExportState.vue.d.ts +0 -7
- package/dist/types/widgets/PopUp.vue.d.ts +0 -22
- package/dist/types/widgets/WidgetsContainer.vue.d.ts +0 -7
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { computed, ref, openBlock, createElementBlock, unref, createCommentVNode } from 'vue';
|
|
1
|
+
import { computed, ref, openBlock, createElementBlock, mergeProps, unref, createCommentVNode } from 'vue';
|
|
2
2
|
import '@eox/layercontrol';
|
|
3
3
|
import '@eox/jsonform';
|
|
4
4
|
import '@eox/timecontrol';
|
|
5
5
|
import 'color-legend-element';
|
|
6
|
-
import {
|
|
6
|
+
import { $ as useSTAcStore, a2 as mapCompareEl, a3 as mapEl, a4 as eodashCompareCollections, a0 as eodashCollections, a5 as getColFromLayer } from './asWebComponent-D8bMMCEr.js';
|
|
7
7
|
import { storeToRefs } from 'pinia';
|
|
8
8
|
|
|
9
9
|
const _hoisted_1 = { class: "d-flex flex-column fill-height overflow-auto" };
|
|
@@ -17,13 +17,24 @@ const _sfc_main = {
|
|
|
17
17
|
type: String,
|
|
18
18
|
default: "first",
|
|
19
19
|
},
|
|
20
|
+
tools: {
|
|
21
|
+
type: Array,
|
|
22
|
+
default: () => ["datetime", "info", "config", "legend", "opacity"],
|
|
23
|
+
},
|
|
24
|
+
cssVars: {
|
|
25
|
+
type: Object,
|
|
26
|
+
},
|
|
20
27
|
},
|
|
21
28
|
setup(__props) {
|
|
22
29
|
|
|
23
30
|
const props = __props;
|
|
24
31
|
|
|
25
|
-
const
|
|
32
|
+
const config = {
|
|
33
|
+
tools: props.tools,
|
|
34
|
+
style: props.cssVars,
|
|
35
|
+
};
|
|
26
36
|
|
|
37
|
+
const { selectedCompareStac, selectedStac } = storeToRefs(useSTAcStore());
|
|
27
38
|
const showControls = computed(() => {
|
|
28
39
|
if (props.map === "second") {
|
|
29
40
|
return mapCompareEl.value !== null && selectedCompareStac.value !== null;
|
|
@@ -90,16 +101,15 @@ const debouncedHandleDateTime = (evt) => {
|
|
|
90
101
|
return (_ctx, _cache) => {
|
|
91
102
|
return (openBlock(), createElementBlock("span", _hoisted_1, [
|
|
92
103
|
(showControls.value)
|
|
93
|
-
? (openBlock(), createElementBlock("eox-layercontrol", {
|
|
94
|
-
key: 0,
|
|
104
|
+
? (openBlock(), createElementBlock("eox-layercontrol", mergeProps({ key: 0 }, config, {
|
|
95
105
|
for: unref(mapElement),
|
|
96
|
-
".tools": ['datetime', 'info', 'config', 'legend', 'opacity'],
|
|
97
106
|
"onDatetime:updated": debouncedHandleDateTime,
|
|
98
107
|
class: "fill-height",
|
|
99
108
|
toolsAsList: "true",
|
|
109
|
+
style: {"--eox-background-color":"transparent"},
|
|
100
110
|
ref_key: "eoxLayercontrol",
|
|
101
111
|
ref: eoxLayercontrol
|
|
102
|
-
}, null,
|
|
112
|
+
}), null, 16 /* FULL_PROPS */, _hoisted_2))
|
|
103
113
|
: createCommentVNode("v-if", true)
|
|
104
114
|
]))
|
|
105
115
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ref, openBlock, createElementBlock, createVNode, withCtx, mergeProps } from 'vue';
|
|
2
|
+
import { a1 as makePanelTransparent, y as VIcon, ak as activeTemplate } from './asWebComponent-D8bMMCEr.js';
|
|
3
|
+
import { mdiViewDashboard } from '@mdi/js';
|
|
4
|
+
import { V as VTooltip } from './VTooltip-C78suika.js';
|
|
5
|
+
|
|
6
|
+
const _sfc_main = {
|
|
7
|
+
__name: 'EodashLayoutSwitcher',
|
|
8
|
+
props: {
|
|
9
|
+
target: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: "main",
|
|
12
|
+
},
|
|
13
|
+
// mdi/js icon
|
|
14
|
+
icon: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: mdiViewDashboard,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/** @type {import("vue").Ref<HTMLDivElement|null>} */
|
|
24
|
+
const rootRef = ref(null);
|
|
25
|
+
makePanelTransparent(rootRef);
|
|
26
|
+
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
return (openBlock(), createElementBlock("div", {
|
|
32
|
+
ref_key: "rootRef",
|
|
33
|
+
ref: rootRef
|
|
34
|
+
}, [
|
|
35
|
+
createVNode(VTooltip, {
|
|
36
|
+
text: `Switch to ${__props.target} mode`
|
|
37
|
+
}, {
|
|
38
|
+
activator: withCtx(({ props }) => [
|
|
39
|
+
createVNode(VIcon, mergeProps(props, {
|
|
40
|
+
onClick: _cache[0] || (_cache[0] = $event => (activeTemplate.value = __props.target)),
|
|
41
|
+
icon: [__props.icon]
|
|
42
|
+
}), null, 16 /* FULL_PROPS */, ["icon"])
|
|
43
|
+
]),
|
|
44
|
+
_: 1 /* STABLE */
|
|
45
|
+
}, 8 /* PROPS */, ["text"])
|
|
46
|
+
], 512 /* NEED_PATCH */))
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export { _sfc_main as default };
|
|
@@ -1,11 +1,51 @@
|
|
|
1
|
-
import { onMounted, onUnmounted, watch, nextTick, ref, computed, openBlock, createElementBlock, createElementVNode } from 'vue';
|
|
1
|
+
import { onMounted, onUnmounted, watch, nextTick, toRaw, ref, computed, openBlock, createElementBlock, createElementVNode, unref } from 'vue';
|
|
2
2
|
import '@eox/map';
|
|
3
3
|
import '@eox/map/src/plugins/advancedLayersAndSources';
|
|
4
|
-
import { a7 as eoxLayersKey,
|
|
4
|
+
import { a6 as registerProjection, a7 as getProjectionCode, a8 as availableMapProjection, a9 as changeMapProjection, aa as eoxLayersKey, $ as useSTAcStore, ab as posIsSetFromUrl, ac as EodashCollection, ad as mapPosition, a3 as mapEl, a2 as mapCompareEl, Z as datetime, a4 as eodashCompareCollections, a0 as eodashCollections } from './asWebComponent-D8bMMCEr.js';
|
|
5
5
|
import { storeToRefs } from 'pinia';
|
|
6
6
|
import log from 'loglevel';
|
|
7
7
|
import { useEventBus } from '@vueuse/core';
|
|
8
8
|
|
|
9
|
+
/*
|
|
10
|
+
* eodashSTAC helpers that utilizes the app states or actions
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* checks if there's a projection on the Collection and
|
|
15
|
+
* updates {@link availableMapProjection}
|
|
16
|
+
* @param {import('stac-ts').StacCollection} [STAcCollection]
|
|
17
|
+
*/
|
|
18
|
+
const setMapProjFromCol = async (STAcCollection) => {
|
|
19
|
+
// if a projection exists on the collection level
|
|
20
|
+
log.debug("Checking for available map projection in indicator");
|
|
21
|
+
const projection =
|
|
22
|
+
/** @type {number | string | {name: string, def: string} | undefined} */
|
|
23
|
+
(
|
|
24
|
+
STAcCollection?.["eodash:mapProjection"] ||
|
|
25
|
+
STAcCollection?.["proj:epsg"] ||
|
|
26
|
+
STAcCollection?.["eodash:proj4_def"]
|
|
27
|
+
);
|
|
28
|
+
if (projection) {
|
|
29
|
+
log.debug("Projection found", projection);
|
|
30
|
+
await registerProjection(projection);
|
|
31
|
+
const projectionCode = getProjectionCode(projection);
|
|
32
|
+
if (availableMapProjection.value !== projectionCode) {
|
|
33
|
+
log.debug(
|
|
34
|
+
"Changing map projection",
|
|
35
|
+
availableMapProjection.value,
|
|
36
|
+
projectionCode,
|
|
37
|
+
);
|
|
38
|
+
await changeMapProjection(projection);
|
|
39
|
+
}
|
|
40
|
+
// set it for `EodashMapBtns`
|
|
41
|
+
availableMapProjection.value = /** @type {string} */ (projectionCode);
|
|
42
|
+
} else {
|
|
43
|
+
// reset to default projection
|
|
44
|
+
log.debug("Resetting projection to default EPSG:3857");
|
|
45
|
+
await changeMapProjection((availableMapProjection.value = ""));
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
9
49
|
/**
|
|
10
50
|
* Holder for previous compare map view as it is overwritten by sync
|
|
11
51
|
* @type { {map:import("ol").View } | null} mapElement
|
|
@@ -13,7 +53,7 @@ import { useEventBus } from '@vueuse/core';
|
|
|
13
53
|
let viewHolder = null;
|
|
14
54
|
|
|
15
55
|
/**
|
|
16
|
-
*
|
|
56
|
+
* Handles updating {@link mapPosition} on movement on the map
|
|
17
57
|
*
|
|
18
58
|
* @param {import("vue").Ref<HTMLElement & Record<string,any> & {map:import("ol").Map } | null>} mapElement
|
|
19
59
|
* @param {import("vue").Ref<(number | undefined)[]>} mapPosition
|
|
@@ -33,6 +73,9 @@ const useHandleMapMoveEnd = (mapElement, mapPosition) => {
|
|
|
33
73
|
!Number.isNaN(z)
|
|
34
74
|
) {
|
|
35
75
|
mapPosition.value = [lonlat[0], lonlat[1], z];
|
|
76
|
+
if (posIsSetFromUrl.value) {
|
|
77
|
+
posIsSetFromUrl.value = false;
|
|
78
|
+
}
|
|
36
79
|
}
|
|
37
80
|
};
|
|
38
81
|
|
|
@@ -74,7 +117,7 @@ const createLayersConfig = async (
|
|
|
74
117
|
type: "Group",
|
|
75
118
|
properties: {
|
|
76
119
|
id: "AnalysisGroup",
|
|
77
|
-
title: "
|
|
120
|
+
title: "Data Layers",
|
|
78
121
|
layerControlExpand: true,
|
|
79
122
|
},
|
|
80
123
|
layers: /** @type {Record<string,any>[]}*/ ([]),
|
|
@@ -99,7 +142,10 @@ const createLayersConfig = async (
|
|
|
99
142
|
const indicatorLayers =
|
|
100
143
|
//@ts-expect-error indicator is collection
|
|
101
144
|
await EodashCollection.getIndicatorLayers(selectedIndicator);
|
|
102
|
-
|
|
145
|
+
const geodbLayer = EodashCollection.getGeoDBLayer(eodashCols);
|
|
146
|
+
if (geodbLayer) {
|
|
147
|
+
dataLayers.layers.push(geodbLayer);
|
|
148
|
+
}
|
|
103
149
|
const baseLayers = {
|
|
104
150
|
type: "Group",
|
|
105
151
|
properties: {
|
|
@@ -194,7 +240,7 @@ const createLayersConfig = async (
|
|
|
194
240
|
};
|
|
195
241
|
|
|
196
242
|
/**
|
|
197
|
-
*
|
|
243
|
+
* Initializes the map and updates it based on changes in the selected indicator and datetime,
|
|
198
244
|
*
|
|
199
245
|
* @param {import("vue").Ref<HTMLElement & Record<string,any> | null>} mapElement
|
|
200
246
|
* @param {import("vue").Ref<import("stac-ts").StacCollection | null>} selectedIndicator
|
|
@@ -306,15 +352,16 @@ const useInitMap = (
|
|
|
306
352
|
// indicator and map changes
|
|
307
353
|
if (
|
|
308
354
|
mapElement?.value?.id === "main" &&
|
|
309
|
-
updatedStac.extent?.spatial.bbox
|
|
355
|
+
updatedStac.extent?.spatial.bbox &&
|
|
356
|
+
!posIsSetFromUrl.value
|
|
310
357
|
) {
|
|
311
358
|
// Sanitize extent,
|
|
312
359
|
const b = updatedStac.extent?.spatial.bbox[0];
|
|
313
360
|
const sanitizedExtent = [
|
|
314
|
-
b[0] > -180 ? b[0] : -180,
|
|
315
|
-
b[1] > -90 ? b[1] : -90,
|
|
316
|
-
b[2] < 180 ? b[2] : 180,
|
|
317
|
-
b[3] < 90 ? b[3] : 90,
|
|
361
|
+
b?.[0] > -180 ? b?.[0] : -180,
|
|
362
|
+
b?.[1] > -90 ? b?.[1] : -90,
|
|
363
|
+
b?.[2] < 180 ? b?.[2] : 180,
|
|
364
|
+
b?.[3] < 90 ? b?.[3] : 90,
|
|
318
365
|
];
|
|
319
366
|
|
|
320
367
|
const reprojExtent = mapElement.value?.transformExtent(
|
|
@@ -322,9 +369,12 @@ const useInitMap = (
|
|
|
322
369
|
"EPSG:4326",
|
|
323
370
|
mapElement.value?.map?.getView().getProjection(),
|
|
324
371
|
);
|
|
325
|
-
/** @type {
|
|
372
|
+
/** @type {import("@eox/map").EOxMap} */
|
|
326
373
|
(mapElement.value).zoomExtent = reprojExtent;
|
|
327
374
|
}
|
|
375
|
+
if (posIsSetFromUrl.value) {
|
|
376
|
+
posIsSetFromUrl.value = false;
|
|
377
|
+
}
|
|
328
378
|
|
|
329
379
|
log.debug(
|
|
330
380
|
"Assigned layers",
|
|
@@ -348,11 +398,25 @@ const useInitMap = (
|
|
|
348
398
|
});
|
|
349
399
|
};
|
|
350
400
|
|
|
401
|
+
/**
|
|
402
|
+
* @module ol/easing
|
|
403
|
+
*/
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Start slow, speed up, and then slow down again.
|
|
408
|
+
* @param {number} t Input between 0 and 1.
|
|
409
|
+
* @return {number} Output between 0 and 1.
|
|
410
|
+
* @api
|
|
411
|
+
*/
|
|
412
|
+
function inAndOut(t) {
|
|
413
|
+
return 3 * t * t - 2 * t * t * t;
|
|
414
|
+
}
|
|
415
|
+
|
|
351
416
|
const _hoisted_1 = [".enabled"];
|
|
352
|
-
const _hoisted_2 = [".layers"];
|
|
417
|
+
const _hoisted_2 = [".center", ".zoom", ".layers"];
|
|
353
418
|
const _hoisted_3 = [".layers"];
|
|
354
419
|
|
|
355
|
-
|
|
356
420
|
const _sfc_main = {
|
|
357
421
|
__name: 'EodashMap',
|
|
358
422
|
props: {
|
|
@@ -360,11 +424,26 @@ const _sfc_main = {
|
|
|
360
424
|
type: Boolean,
|
|
361
425
|
default: false,
|
|
362
426
|
},
|
|
427
|
+
/** @type {import("vue").PropType<[number,number]>} */
|
|
428
|
+
center: {
|
|
429
|
+
//@ts-expect-error todo
|
|
430
|
+
type: Array,
|
|
431
|
+
default: () => [15, 48],
|
|
432
|
+
},
|
|
433
|
+
zoom: {
|
|
434
|
+
type: Number,
|
|
435
|
+
default: 4,
|
|
436
|
+
},
|
|
363
437
|
},
|
|
364
438
|
setup(__props) {
|
|
365
439
|
|
|
366
440
|
const props = __props;
|
|
367
441
|
|
|
442
|
+
const initialCenter = toRaw([
|
|
443
|
+
mapPosition.value?.[0] ?? props.center?.[0],
|
|
444
|
+
mapPosition.value?.[1] ?? props.center?.[1],
|
|
445
|
+
]);
|
|
446
|
+
const initialZoom = toRaw(mapPosition.value?.[2] ?? props.zoom);
|
|
368
447
|
/** @type {import("vue").Ref<Record<string,any>[]>} */
|
|
369
448
|
const eoxMapLayers = ref([
|
|
370
449
|
{
|
|
@@ -389,32 +468,15 @@ const eoxMapCompareLayers = ref([
|
|
|
389
468
|
},
|
|
390
469
|
]);
|
|
391
470
|
|
|
471
|
+
const animationOptions = {
|
|
472
|
+
duration: 1200,
|
|
473
|
+
easing: inAndOut,
|
|
474
|
+
};
|
|
475
|
+
|
|
392
476
|
/** @type {import("vue").Ref<(HTMLElement & Record<string,any> & { map:import("ol").Map }) | null>} */
|
|
393
477
|
const eoxMap = ref(null);
|
|
394
478
|
/** @type {import("vue").Ref<(HTMLElement & Record<string,any> & { map:import("ol").Map }) | null>} */
|
|
395
479
|
const compareMap = ref(null);
|
|
396
|
-
|
|
397
|
-
const eoxMapConfig = {
|
|
398
|
-
/** @type {(number|undefined)[] | undefined} */
|
|
399
|
-
center: [15, 48],
|
|
400
|
-
/** @type {number | undefined} */
|
|
401
|
-
zoom: 4,
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
const eoxCompareMapConfig = {
|
|
405
|
-
/** @type {(number|undefined)[] | undefined} */
|
|
406
|
-
center: [15, 48],
|
|
407
|
-
/** @type {number | undefined} */
|
|
408
|
-
zoom: 4,
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
// Check if selected indicator was already set in store
|
|
412
|
-
if (mapPosition && mapPosition.value && mapPosition.value.length === 3) {
|
|
413
|
-
// TODO: do further checks for invalid values?
|
|
414
|
-
// TODO: can we expect the values to be in a specific projection
|
|
415
|
-
eoxMapConfig.center = [mapPosition.value?.[0], mapPosition.value[1]];
|
|
416
|
-
eoxMapConfig.zoom = mapPosition.value[2];
|
|
417
|
-
}
|
|
418
480
|
const { selectedCompareStac } = storeToRefs(useSTAcStore());
|
|
419
481
|
const showCompare = computed(() =>
|
|
420
482
|
props.enableCompare && !!selectedCompareStac.value ? "" : "first",
|
|
@@ -464,8 +526,10 @@ return (_ctx, _cache) => {
|
|
|
464
526
|
slot: "first",
|
|
465
527
|
ref_key: "eoxMap",
|
|
466
528
|
ref: eoxMap,
|
|
467
|
-
".config": eoxMapConfig,
|
|
468
529
|
id: "main",
|
|
530
|
+
".animationOptions": animationOptions,
|
|
531
|
+
".center": unref(initialCenter),
|
|
532
|
+
".zoom": unref(initialZoom),
|
|
469
533
|
".layers": eoxMapLayers.value
|
|
470
534
|
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_2),
|
|
471
535
|
createElementVNode("eox-map", {
|
|
@@ -474,7 +538,6 @@ return (_ctx, _cache) => {
|
|
|
474
538
|
slot: "second",
|
|
475
539
|
ref_key: "compareMap",
|
|
476
540
|
ref: compareMap,
|
|
477
|
-
".config": eoxCompareMapConfig,
|
|
478
541
|
".layers": eoxMapCompareLayers.value
|
|
479
542
|
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_3)
|
|
480
543
|
], 40 /* PROPS, NEED_HYDRATION */, _hoisted_1))
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { computed, ref, openBlock, createElementBlock, createBlock, unref, createCommentVNode, createVNode, withCtx } from 'vue';
|
|
2
|
+
import { _ as _export_sfc, t as useDisplay, a1 as makePanelTransparent, V as VBtn, a8 as availableMapProjection, a9 as changeMapProjection, ae as setActiveTemplate } from './asWebComponent-D8bMMCEr.js';
|
|
3
|
+
import { mdiMapPlus, mdiEarthBox, mdiCompare } from '@mdi/js';
|
|
4
|
+
import ExportState from './ExportState-LNZAovzM.js';
|
|
5
|
+
import _sfc_main$1 from './PopUp-B0_c0207.js';
|
|
6
|
+
import _sfc_main$2 from './EodashItemFilter-CFNKjm_Z.js';
|
|
7
|
+
|
|
8
|
+
const _sfc_main = {
|
|
9
|
+
__name: 'EodashMapBtns',
|
|
10
|
+
props: {
|
|
11
|
+
exportMap: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: true,
|
|
14
|
+
},
|
|
15
|
+
changeProjection: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: true,
|
|
18
|
+
},
|
|
19
|
+
compareIndicators: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
setup(__props) {
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const { smAndDown } = useDisplay();
|
|
28
|
+
const popupWidth = computed(() => (smAndDown ? "70%" : "500px"));
|
|
29
|
+
const popupHeight = computed(() => (smAndDown ? "90%" : "500px"));
|
|
30
|
+
|
|
31
|
+
const showMapState = ref(false);
|
|
32
|
+
const showCompareIndicators = ref(false);
|
|
33
|
+
|
|
34
|
+
/** @type {import("vue").Ref<HTMLDivElement|null>} */
|
|
35
|
+
const rootRef = ref(null);
|
|
36
|
+
|
|
37
|
+
const onSelectCompareIndicator = () => {
|
|
38
|
+
setActiveTemplate("compare");
|
|
39
|
+
showCompareIndicators.value = !showCompareIndicators.value;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
makePanelTransparent(rootRef);
|
|
43
|
+
|
|
44
|
+
return (_ctx, _cache) => {
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
return (openBlock(), createElementBlock("div", {
|
|
48
|
+
ref_key: "rootRef",
|
|
49
|
+
ref: rootRef,
|
|
50
|
+
class: "d-flex flex-column align-end justify-end my-3 pa-2"
|
|
51
|
+
}, [
|
|
52
|
+
(__props.exportMap)
|
|
53
|
+
? (openBlock(), createBlock(VBtn, {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "map-btn",
|
|
56
|
+
icon: [unref(mdiMapPlus)],
|
|
57
|
+
onClick: _cache[0] || (_cache[0] = $event => (showMapState.value = !showMapState.value))
|
|
58
|
+
}, null, 8 /* PROPS */, ["icon"]))
|
|
59
|
+
: createCommentVNode("v-if", true),
|
|
60
|
+
(__props.exportMap)
|
|
61
|
+
? (openBlock(), createBlock(ExportState, {
|
|
62
|
+
key: 1,
|
|
63
|
+
modelValue: showMapState.value,
|
|
64
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => ((showMapState).value = $event))
|
|
65
|
+
}, null, 8 /* PROPS */, ["modelValue"]))
|
|
66
|
+
: createCommentVNode("v-if", true),
|
|
67
|
+
(__props.changeProjection && !!unref(availableMapProjection))
|
|
68
|
+
? (openBlock(), createBlock(VBtn, {
|
|
69
|
+
key: 2,
|
|
70
|
+
class: "map-btn",
|
|
71
|
+
icon: [unref(mdiEarthBox)],
|
|
72
|
+
onClick: _cache[2] || (_cache[2] = $event => (unref(changeMapProjection)(unref(availableMapProjection))))
|
|
73
|
+
}, null, 8 /* PROPS */, ["icon"]))
|
|
74
|
+
: createCommentVNode("v-if", true),
|
|
75
|
+
(__props.compareIndicators)
|
|
76
|
+
? (openBlock(), createBlock(VBtn, {
|
|
77
|
+
key: 3,
|
|
78
|
+
class: "map-btn",
|
|
79
|
+
icon: [unref(mdiCompare)],
|
|
80
|
+
onClick: _cache[3] || (_cache[3] = $event => (showCompareIndicators.value = !showCompareIndicators.value))
|
|
81
|
+
}, null, 8 /* PROPS */, ["icon"]))
|
|
82
|
+
: createCommentVNode("v-if", true),
|
|
83
|
+
createVNode(_sfc_main$1, {
|
|
84
|
+
modelValue: showCompareIndicators.value,
|
|
85
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = $event => ((showCompareIndicators).value = $event)),
|
|
86
|
+
maxWidth: popupWidth.value,
|
|
87
|
+
maxHeight: popupHeight.value
|
|
88
|
+
}, {
|
|
89
|
+
default: withCtx(() => [
|
|
90
|
+
createVNode(_sfc_main$2, {
|
|
91
|
+
enableCompare: true,
|
|
92
|
+
"filters-title": "",
|
|
93
|
+
"results-title": "Select an indicator to compare",
|
|
94
|
+
"filter-properties": [],
|
|
95
|
+
onSelect: onSelectCompareIndicator
|
|
96
|
+
})
|
|
97
|
+
]),
|
|
98
|
+
_: 1 /* STABLE */
|
|
99
|
+
}, 8 /* PROPS */, ["modelValue", "maxWidth", "maxHeight"])
|
|
100
|
+
], 512 /* NEED_PATCH */))
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
};
|
|
105
|
+
const EodashMapBtns = /*#__PURE__*/_export_sfc(_sfc_main, [['__scopeId',"data-v-37c140ec"]]);
|
|
106
|
+
|
|
107
|
+
export { EodashMapBtns as default };
|