@eodash/eodash 5.0.0-alpha.2.26 → 5.0.0-alpha.2.27
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 -13
- 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 +39 -14
- package/core/client/composables/EodashProcess.js +574 -0
- package/core/client/composables/index.js +54 -11
- package/core/client/eodash.js +383 -125
- package/core/client/{utils/eodashSTAC.js → eodashSTAC/EodashCollection.js} +75 -41
- package/core/client/{utils → eodashSTAC}/createLayers.js +10 -8
- package/core/client/{utils → eodashSTAC}/helpers.js +47 -75
- 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/keys.js +2 -0
- package/core/client/utils/states.js +8 -3
- package/core/client/views/Dashboard.vue +6 -4
- package/core/client/vite-env.d.ts +1 -16
- package/dist/client/{DashboardLayout-E_JzgCH5.js → DashboardLayout-232tRmjz.js} +23 -25
- package/dist/client/{DynamicWebComponent-C9pVUfT3.js → DynamicWebComponent-Cl4LqHU6.js} +1 -1
- package/dist/client/{EodashDatePicker-CjU8R2ia.js → EodashDatePicker-Pok6bZwU.js} +78 -165
- package/dist/client/EodashItemFilter-16eMMjTV.js +151 -0
- package/dist/client/{EodashLayerControl-mKfwru42.js → EodashLayerControl-De7IlCm_.js} +19 -11
- package/dist/client/EodashLayoutSwitcher-C-3-jjn5.js +52 -0
- package/dist/client/{EodashMap-BpwL82-w.js → EodashMap-CMvbfI6-.js} +116 -39
- package/dist/client/EodashMapBtns-BeknGDtc.js +107 -0
- package/dist/client/EodashProcess-BwKAa9Ee.js +1476 -0
- package/dist/client/EodashStacInfo-_BfonNUG.js +85 -0
- package/dist/client/EodashTools-PD3XPYuR.js +103 -0
- package/dist/client/{ExportState-ByVuIAQb.js → ExportState-DOrT7M15.js} +5 -5
- package/dist/client/{Footer-D691KLtK.js → Footer-CCigxYBo.js} +1 -1
- package/dist/client/{Header-B8UBQstf.js → Header-C2cdx4gb.js} +3 -3
- package/dist/client/{MobileLayout-6bHjYguI.js → MobileLayout-BdiFjHg7.js} +28 -31
- package/dist/client/{PopUp-CdFcnKMY.js → PopUp--_xn1Cms.js} +37 -9
- package/dist/client/{VImg-fKGJ7xyb.js → VImg-9xu2l99m.js} +2 -2
- package/dist/client/{VMain-Hf5R6yWY.js → VMain-BUs3kDTd.js} +1 -1
- package/dist/client/{VOverlay-ClFjEtlD.js → VOverlay-D89omJis.js} +3 -3
- package/dist/client/VTooltip-CDu3bErh.js +86 -0
- package/dist/client/{WidgetsContainer-XXYJfaPR.js → WidgetsContainer-aFG9yFT6.js} +1 -1
- package/dist/client/{asWebComponent-BsbKnhGV.js → asWebComponent-BRGyP_j5.js} +1495 -1142
- package/dist/client/{style.css → eo-dash.css} +2 -2
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-I2EA3z3_.js → forwardRefs-CYrR6bMw.js} +1 -1
- package/dist/client/{index-B3dnMr8a.js → index-BZwk0V42.js} +1 -1
- package/dist/client/{transition-DJ9gfiuP.js → transition-DG9nRSW4.js} +1 -1
- package/dist/node/cli.js +3 -3
- package/package.json +56 -34
- package/widgets/EodashDatePicker.vue +68 -54
- package/widgets/EodashItemFilter.vue +60 -105
- package/widgets/EodashLayerControl.vue +19 -8
- package/widgets/EodashLayoutSwitcher.vue +36 -0
- package/widgets/EodashMap.vue +27 -28
- package/widgets/EodashMapBtns.vue +41 -4
- package/widgets/EodashProcess.vue +143 -0
- package/widgets/EodashStacInfo.vue +82 -0
- package/widgets/EodashTools.vue +83 -0
- package/widgets/ExportState.vue +3 -3
- 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-VGQasaBJ.js +0 -194
- package/dist/client/EodashMapBtns-GNNBdBW9.js +0 -66
- 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/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 -29
- 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 -11
- package/dist/types/core/client/store/States.d.ts +0 -21
- 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 -33
- package/dist/types/widgets/EodashLayerControl.vue.d.ts +0 -7
- package/dist/types/widgets/EodashMap.vue.d.ts +0 -7
- package/dist/types/widgets/EodashMapBtns.vue.d.ts +0 -9
- package/dist/types/widgets/ExportState.vue.d.ts +0 -7
- package/dist/types/widgets/PopUp.vue.d.ts +0 -14
- package/dist/types/widgets/WidgetsContainer.vue.d.ts +0 -7
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import App from "./App.vue";
|
|
2
2
|
import { defineCustomElement } from "vue";
|
|
3
3
|
import { registerPlugins } from "./plugins";
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* @type {import("vue").VueElementConstructor<
|
|
7
6
|
* import("vue").ExtractPropTypes<{ config: string }>>}
|
|
8
7
|
* */
|
|
9
|
-
export const
|
|
8
|
+
export const EodashConstructor = defineCustomElement(App, {
|
|
10
9
|
shadowRoot: false,
|
|
11
10
|
configureApp(app) {
|
|
12
11
|
registerPlugins(app);
|
|
@@ -14,7 +13,7 @@ export const Eodash = defineCustomElement(App, {
|
|
|
14
13
|
});
|
|
15
14
|
|
|
16
15
|
export function register() {
|
|
17
|
-
customElements.define("eo-dash",
|
|
16
|
+
customElements.define("eo-dash", EodashConstructor);
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
export { default as store } from "@/store";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-main>
|
|
3
|
-
<eox-layout :gap="
|
|
3
|
+
<eox-layout :gap="gap" :style="`padding: ${gap}px`">
|
|
4
4
|
<eox-layout-item
|
|
5
|
-
v-if="bgWidget
|
|
5
|
+
v-if="bgWidget?.component"
|
|
6
6
|
class="bg-panel bg-surface"
|
|
7
|
+
:style="`margin: -${gap + 1}px;`"
|
|
7
8
|
x="0"
|
|
8
9
|
y="0"
|
|
9
10
|
h="12"
|
|
@@ -12,14 +13,15 @@
|
|
|
12
13
|
<Suspense suspensible>
|
|
13
14
|
<component
|
|
14
15
|
id="bg-widget"
|
|
15
|
-
:is="bgWidget
|
|
16
|
-
v-bind="bgWidget
|
|
16
|
+
:is="bgWidget?.component"
|
|
17
|
+
v-bind="bgWidget?.props"
|
|
17
18
|
/>
|
|
18
19
|
</Suspense>
|
|
19
20
|
</eox-layout-item>
|
|
20
21
|
<template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
|
|
21
22
|
<Transition name="fade">
|
|
22
23
|
<eox-layout-item
|
|
24
|
+
:id="importedWidget.value.id.toString()"
|
|
23
25
|
v-if="importedWidget.value.component"
|
|
24
26
|
:key="importedWidget.value.id"
|
|
25
27
|
class="panel bg-surface"
|
|
@@ -42,27 +44,21 @@
|
|
|
42
44
|
</v-main>
|
|
43
45
|
</template>
|
|
44
46
|
<script setup>
|
|
45
|
-
import { eodashKey } from "@/utils/keys";
|
|
46
|
-
import { inject } from "vue";
|
|
47
|
-
import { useDefineWidgets } from "@/composables/DefineWidgets";
|
|
48
47
|
import "@eox/layout";
|
|
48
|
+
import { useDefineTemplate } from "@/composables/DefineTemplate";
|
|
49
49
|
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
const [bgWidget] = useDefineWidgets([eodash.template?.background]);
|
|
53
|
-
|
|
54
|
-
const importedWidgets = useDefineWidgets(eodash.template?.widgets);
|
|
50
|
+
const { bgWidget, importedWidgets, gap } = useDefineTemplate();
|
|
55
51
|
</script>
|
|
56
52
|
<style scoped>
|
|
57
53
|
.panel {
|
|
58
54
|
position: relative;
|
|
59
55
|
overflow: visible;
|
|
60
56
|
z-index: 1;
|
|
61
|
-
border-radius: 0px;
|
|
62
57
|
}
|
|
63
58
|
|
|
64
59
|
.bg-panel {
|
|
65
60
|
z-index: 0;
|
|
61
|
+
border-radius: 0px !important;
|
|
66
62
|
}
|
|
67
63
|
|
|
68
64
|
.fade-enter-active,
|
|
@@ -74,4 +70,30 @@ const importedWidgets = useDefineWidgets(eodash.template?.widgets);
|
|
|
74
70
|
.fade-leave-to {
|
|
75
71
|
opacity: 0;
|
|
76
72
|
}
|
|
73
|
+
:deep(.bg-surface) {
|
|
74
|
+
backdrop-filter: blur(9.5px) !important;
|
|
75
|
+
background-color: rgba(
|
|
76
|
+
var(--v-theme-surface),
|
|
77
|
+
var(--v-surface-opacity, 0.8)
|
|
78
|
+
) !important;
|
|
79
|
+
border-radius: 4px;
|
|
80
|
+
border-style: solid;
|
|
81
|
+
border-width: 1px;
|
|
82
|
+
border-color: rgb(var(--v-theme-surface));
|
|
83
|
+
scrollbar-color: rgba(var(--v-theme-on-surface), 0.2) transparent;
|
|
84
|
+
scrollbar-width: thin;
|
|
85
|
+
}
|
|
86
|
+
:deep(.bg-primary) {
|
|
87
|
+
backdrop-filter: blur(9.5px) !important;
|
|
88
|
+
background-color: rgba(
|
|
89
|
+
var(--v-theme-primary),
|
|
90
|
+
var(--v-primary-opacity, 0.8)
|
|
91
|
+
) !important;
|
|
92
|
+
border-radius: 4px;
|
|
93
|
+
border-style: solid;
|
|
94
|
+
border-width: 1px;
|
|
95
|
+
border-color: rgb(var(--v-theme-primary));
|
|
96
|
+
scrollbar-color: rgba(var(--v-theme-on-primary), 0.2) transparent;
|
|
97
|
+
scrollbar-width: thin;
|
|
98
|
+
}
|
|
77
99
|
</style>
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
<ErrorAlert v-model="error" />
|
|
5
5
|
<Suspense>
|
|
6
6
|
<component
|
|
7
|
-
v-if="loading
|
|
8
|
-
:is="loading
|
|
9
|
-
v-bind="loading
|
|
7
|
+
v-if="loading?.component"
|
|
8
|
+
:is="loading?.component"
|
|
9
|
+
v-bind="loading?.props"
|
|
10
10
|
></component>
|
|
11
11
|
<div v-else class="text-center">Loading...</div>
|
|
12
12
|
<template #fallback>
|
|
@@ -17,14 +17,11 @@
|
|
|
17
17
|
</v-row>
|
|
18
18
|
</template>
|
|
19
19
|
<script setup>
|
|
20
|
-
import {
|
|
21
|
-
import { eodashKey } from "@/utils/keys";
|
|
22
|
-
import { useDefineWidgets } from "@/composables/DefineWidgets";
|
|
20
|
+
import { onErrorCaptured, ref } from "vue";
|
|
23
21
|
import ErrorAlert from "./ErrorAlert.vue";
|
|
22
|
+
import { useDefineTemplate } from "@/composables/DefineTemplate";
|
|
24
23
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const [loading] = useDefineWidgets([eodash.template.loading]);
|
|
24
|
+
const { loading } = useDefineTemplate();
|
|
28
25
|
|
|
29
26
|
const error = ref("");
|
|
30
27
|
onErrorCaptured((e, inst, info) => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<Suspense suspensible>
|
|
4
4
|
<component
|
|
5
5
|
id="bg-widget"
|
|
6
|
-
v-if="bgWidget
|
|
6
|
+
v-if="bgWidget?.component"
|
|
7
7
|
:is="bgWidget.component"
|
|
8
8
|
v-bind="bgWidget.props"
|
|
9
9
|
></component>
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
id="overlay"
|
|
17
17
|
class="pa-2 panel bg-surface"
|
|
18
18
|
>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
<div class="d-flex py-2 justify-end align-end">
|
|
20
|
+
<v-btn icon variant="text" class="close-btn" @click="activeIdx = -1"
|
|
21
|
+
>✕</v-btn
|
|
22
|
+
>
|
|
23
|
+
</div>
|
|
22
24
|
<Suspense suspensible>
|
|
23
25
|
<div class="component-container" v-show="activeIdx === idx">
|
|
24
26
|
<component
|
|
@@ -48,18 +50,11 @@
|
|
|
48
50
|
</v-main>
|
|
49
51
|
</template>
|
|
50
52
|
<script setup>
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import { useDefineWidgets } from "@/composables/DefineWidgets";
|
|
53
|
+
import { useDefineTemplate } from "@/composables/DefineTemplate";
|
|
54
|
+
import { ref, onMounted } from "vue";
|
|
54
55
|
import { useLayout } from "vuetify";
|
|
55
56
|
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
//import widgets
|
|
59
|
-
const widgetsConfig = eodash.template.widgets;
|
|
60
|
-
const importedWidgets = useDefineWidgets(widgetsConfig);
|
|
61
|
-
const [bgWidget] = useDefineWidgets([eodash.template?.background]);
|
|
62
|
-
|
|
57
|
+
const { bgWidget, importedWidgets } = useDefineTemplate();
|
|
63
58
|
const { mainRect } = useLayout();
|
|
64
59
|
|
|
65
60
|
const activeIdx = ref(-1);
|
|
@@ -106,4 +101,11 @@ onMounted(() => {
|
|
|
106
101
|
position: relative;
|
|
107
102
|
z-index: 10;
|
|
108
103
|
}
|
|
104
|
+
:deep(.bg-surface) {
|
|
105
|
+
backdrop-filter: blur(9.5px) !important;
|
|
106
|
+
background-color: rgba(
|
|
107
|
+
var(--v-theme-surface),
|
|
108
|
+
var(--v-surface-opacity, 0.8)
|
|
109
|
+
) !important;
|
|
110
|
+
}
|
|
109
111
|
</style>
|
|
@@ -3,8 +3,7 @@ import { eodashKey } from "@/utils/keys";
|
|
|
3
3
|
import { inject } from "vue";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* it to `eodash`
|
|
6
|
+
* Handles importing user defined instance of Eodash
|
|
8
7
|
*
|
|
9
8
|
* @async
|
|
10
9
|
* @param {string | undefined} runtimeConfig
|
|
@@ -15,6 +14,17 @@ export const useEodashRuntime = async (runtimeConfig) => {
|
|
|
15
14
|
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
16
15
|
/** @param {import("@/types").Eodash} config */
|
|
17
16
|
const assignInstance = (config) => {
|
|
17
|
+
if ("template" in config) {
|
|
18
|
+
//@ts-expect-error to do
|
|
19
|
+
delete eodash.templates;
|
|
20
|
+
//@ts-expect-error to do
|
|
21
|
+
eodash.template = config.template;
|
|
22
|
+
} else if ("templates" in config) {
|
|
23
|
+
//@ts-expect-error to do
|
|
24
|
+
delete eodash.template;
|
|
25
|
+
//@ts-expect-error to do
|
|
26
|
+
eodash.templates = config.templates;
|
|
27
|
+
}
|
|
18
28
|
/** @type {(keyof import("@/types").Eodash)[]} */ (
|
|
19
29
|
Object.keys(eodash)
|
|
20
30
|
).forEach((key) => {
|
|
@@ -54,7 +64,7 @@ export const useEodashRuntime = async (runtimeConfig) => {
|
|
|
54
64
|
|
|
55
65
|
/**
|
|
56
66
|
* @param {((
|
|
57
|
-
* store: import("@/
|
|
67
|
+
* store: typeof import("@/store").default,
|
|
58
68
|
* ) => (Promise<import("@/types").Eodash> | import("@/types").Eodash))
|
|
59
69
|
* | import("@/types").Eodash} config
|
|
60
70
|
*/
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { eodashKey } from "@/utils/keys";
|
|
2
|
+
import { inject, ref, shallowReactive, shallowRef, toRefs, watch } from "vue";
|
|
3
|
+
import { useDefineWidgets } from "./DefineWidgets";
|
|
4
|
+
import { activeTemplate } from "@/store/states";
|
|
5
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
6
|
+
import log from "loglevel";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {{
|
|
10
|
+
* bgWidget:ReturnType< typeof import("./DefineWidgets").useDefineWidgets>[number]| import("vue").ShallowRef<null>
|
|
11
|
+
* loading: ReturnType< typeof import("./DefineWidgets").useDefineWidgets>[number]| import("vue").ShallowRef<null>
|
|
12
|
+
* importedWidgets:ReturnType< typeof import("./DefineWidgets").useDefineWidgets>
|
|
13
|
+
* gap: import("vue").Ref<number>
|
|
14
|
+
* }} DefinedTemplate
|
|
15
|
+
**/
|
|
16
|
+
|
|
17
|
+
const useTemplate = () => {
|
|
18
|
+
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
19
|
+
|
|
20
|
+
/** @type {DefinedTemplate} */
|
|
21
|
+
const definedTemplate = shallowReactive({
|
|
22
|
+
bgWidget: shallowRef(null),
|
|
23
|
+
importedWidgets: [],
|
|
24
|
+
loading: shallowRef(null),
|
|
25
|
+
gap: ref(16),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
if ("template" in eodash) {
|
|
29
|
+
[definedTemplate.bgWidget] = useDefineWidgets([eodash.template.background]);
|
|
30
|
+
[definedTemplate.loading] = useDefineWidgets([eodash.template.loading]);
|
|
31
|
+
definedTemplate.importedWidgets = useDefineWidgets(eodash.template.widgets);
|
|
32
|
+
definedTemplate.gap.value = eodash.template.gap ?? 16;
|
|
33
|
+
} else {
|
|
34
|
+
watch(
|
|
35
|
+
activeTemplate,
|
|
36
|
+
(template) => {
|
|
37
|
+
log.debug("Active template watcher triggered, changing to:", template);
|
|
38
|
+
if (!template) {
|
|
39
|
+
template = Object.keys(eodash.templates)[0];
|
|
40
|
+
activeTemplate.value = template ?? "";
|
|
41
|
+
log.debug("No template found, setting to first template", template);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!template || !eodash.templates[template]) {
|
|
45
|
+
console.error(`[eodash] template not found`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const templateConfig = eodash.templates[template];
|
|
50
|
+
[definedTemplate.bgWidget] = useDefineWidgets([
|
|
51
|
+
templateConfig.background,
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
[definedTemplate.loading] = useDefineWidgets([templateConfig.loading]);
|
|
55
|
+
|
|
56
|
+
definedTemplate.importedWidgets = useDefineWidgets(
|
|
57
|
+
templateConfig.widgets,
|
|
58
|
+
);
|
|
59
|
+
definedTemplate.gap.value = templateConfig.gap ?? 16;
|
|
60
|
+
},
|
|
61
|
+
{ immediate: true },
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
return toRefs(definedTemplate);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const useDefineTemplate = createSharedComposable(useTemplate);
|
|
@@ -13,7 +13,9 @@ import { storeToRefs } from "pinia";
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
/** @typedef {import("vue").ShallowRef<DefinedWidget>} ReactiveDefinedWidget */
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Widgets import map that is created from eodash internals and user defined widgets
|
|
18
|
+
*/
|
|
17
19
|
const internalWidgets = (() => {
|
|
18
20
|
/** @type {Record<string, () => Promise<import("vue").Component>>} */
|
|
19
21
|
const importMap = {
|
|
@@ -44,7 +46,6 @@ const internalWidgets = (() => {
|
|
|
44
46
|
* | undefined
|
|
45
47
|
* )[]
|
|
46
48
|
* | undefined} widgetConfigs
|
|
47
|
-
* @returns {ReactiveDefinedWidget[]}
|
|
48
49
|
*/
|
|
49
50
|
export const useDefineWidgets = (widgetConfigs) => {
|
|
50
51
|
/** @type {ReactiveDefinedWidget[]} */
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { EodashCollection } from "@/
|
|
2
|
-
import { setMapProjFromCol } from "@/
|
|
3
|
-
import { onMounted, onUnmounted, watch } from "vue";
|
|
1
|
+
import { EodashCollection } from "@/eodashSTAC/EodashCollection";
|
|
2
|
+
import { setMapProjFromCol } from "@/eodashSTAC/triggers";
|
|
3
|
+
import { nextTick, onMounted, onUnmounted, watch } from "vue";
|
|
4
4
|
import log from "loglevel";
|
|
5
5
|
import { useSTAcStore } from "@/store/stac";
|
|
6
6
|
import { storeToRefs } from "pinia";
|
|
7
|
-
|
|
7
|
+
import { useEventBus } from "@vueuse/core";
|
|
8
|
+
import { eoxLayersKey } from "@/utils/keys";
|
|
9
|
+
import { posIsSetFromUrl } from "@/utils/states";
|
|
8
10
|
/**
|
|
9
11
|
* Holder for previous compare map view as it is overwritten by sync
|
|
10
12
|
* @type { {map:import("ol").View } | null} mapElement
|
|
@@ -12,7 +14,7 @@ import { storeToRefs } from "pinia";
|
|
|
12
14
|
let viewHolder = null;
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
|
-
*
|
|
17
|
+
* Handles updating {@link mapPosition} on movement on the map
|
|
16
18
|
*
|
|
17
19
|
* @param {import("vue").Ref<HTMLElement & Record<string,any> & {map:import("ol").Map } | null>} mapElement
|
|
18
20
|
* @param {import("vue").Ref<(number | undefined)[]>} mapPosition
|
|
@@ -32,6 +34,9 @@ export const useHandleMapMoveEnd = (mapElement, mapPosition) => {
|
|
|
32
34
|
!Number.isNaN(z)
|
|
33
35
|
) {
|
|
34
36
|
mapPosition.value = [lonlat[0], lonlat[1], z];
|
|
37
|
+
if (posIsSetFromUrl.value) {
|
|
38
|
+
posIsSetFromUrl.value = false;
|
|
39
|
+
}
|
|
35
40
|
}
|
|
36
41
|
};
|
|
37
42
|
|
|
@@ -73,7 +78,7 @@ const createLayersConfig = async (
|
|
|
73
78
|
type: "Group",
|
|
74
79
|
properties: {
|
|
75
80
|
id: "AnalysisGroup",
|
|
76
|
-
title: "
|
|
81
|
+
title: "Data Layers",
|
|
77
82
|
layerControlExpand: true,
|
|
78
83
|
},
|
|
79
84
|
layers: /** @type {Record<string,any>[]}*/ ([]),
|
|
@@ -98,7 +103,10 @@ const createLayersConfig = async (
|
|
|
98
103
|
const indicatorLayers =
|
|
99
104
|
//@ts-expect-error indicator is collection
|
|
100
105
|
await EodashCollection.getIndicatorLayers(selectedIndicator);
|
|
101
|
-
|
|
106
|
+
const geodbLayer = EodashCollection.getGeoDBLayer(eodashCols);
|
|
107
|
+
if (geodbLayer) {
|
|
108
|
+
dataLayers.layers.push(geodbLayer);
|
|
109
|
+
}
|
|
102
110
|
const baseLayers = {
|
|
103
111
|
type: "Group",
|
|
104
112
|
properties: {
|
|
@@ -193,7 +201,7 @@ const createLayersConfig = async (
|
|
|
193
201
|
};
|
|
194
202
|
|
|
195
203
|
/**
|
|
196
|
-
*
|
|
204
|
+
* Initializes the map and updates it based on changes in the selected indicator and datetime,
|
|
197
205
|
*
|
|
198
206
|
* @param {import("vue").Ref<HTMLElement & Record<string,any> | null>} mapElement
|
|
199
207
|
* @param {import("vue").Ref<import("stac-ts").StacCollection | null>} selectedIndicator
|
|
@@ -217,6 +225,7 @@ export const useInitMap = (
|
|
|
217
225
|
eodashCols.values,
|
|
218
226
|
datetime.value,
|
|
219
227
|
);
|
|
228
|
+
const layersEvent = useEventBus(eoxLayersKey);
|
|
220
229
|
|
|
221
230
|
const stopIndicatorWatcher = watch(
|
|
222
231
|
[selectedIndicator, datetime],
|
|
@@ -269,6 +278,9 @@ export const useInitMap = (
|
|
|
269
278
|
JSON.parse(JSON.stringify(layersCollection)),
|
|
270
279
|
);
|
|
271
280
|
mapLayers.value = layersCollection;
|
|
281
|
+
await nextTick(() => {
|
|
282
|
+
layersEvent.emit("time:updated", mapLayers.value);
|
|
283
|
+
});
|
|
272
284
|
return;
|
|
273
285
|
}
|
|
274
286
|
|
|
@@ -299,14 +311,18 @@ export const useInitMap = (
|
|
|
299
311
|
|
|
300
312
|
// Try to move map view to extent only when main
|
|
301
313
|
// indicator and map changes
|
|
302
|
-
if (
|
|
314
|
+
if (
|
|
315
|
+
mapElement?.value?.id === "main" &&
|
|
316
|
+
updatedStac.extent?.spatial.bbox &&
|
|
317
|
+
!posIsSetFromUrl.value
|
|
318
|
+
) {
|
|
303
319
|
// Sanitize extent,
|
|
304
320
|
const b = updatedStac.extent?.spatial.bbox[0];
|
|
305
321
|
const sanitizedExtent = [
|
|
306
|
-
b[0] > -180 ? b[0] : -180,
|
|
307
|
-
b[1] > -90 ? b[1] : -90,
|
|
308
|
-
b[2] < 180 ? b[2] : 180,
|
|
309
|
-
b[3] < 90 ? b[3] : 90,
|
|
322
|
+
b?.[0] > -180 ? b?.[0] : -180,
|
|
323
|
+
b?.[1] > -90 ? b?.[1] : -90,
|
|
324
|
+
b?.[2] < 180 ? b?.[2] : 180,
|
|
325
|
+
b?.[3] < 90 ? b?.[3] : 90,
|
|
310
326
|
];
|
|
311
327
|
|
|
312
328
|
const reprojExtent = mapElement.value?.transformExtent(
|
|
@@ -314,9 +330,12 @@ export const useInitMap = (
|
|
|
314
330
|
"EPSG:4326",
|
|
315
331
|
mapElement.value?.map?.getView().getProjection(),
|
|
316
332
|
);
|
|
317
|
-
/** @type {
|
|
333
|
+
/** @type {import("@eox/map").EOxMap} */
|
|
318
334
|
(mapElement.value).zoomExtent = reprojExtent;
|
|
319
335
|
}
|
|
336
|
+
if (posIsSetFromUrl.value) {
|
|
337
|
+
posIsSetFromUrl.value = false;
|
|
338
|
+
}
|
|
320
339
|
|
|
321
340
|
log.debug(
|
|
322
341
|
"Assigned layers",
|
|
@@ -324,6 +343,12 @@ export const useInitMap = (
|
|
|
324
343
|
);
|
|
325
344
|
|
|
326
345
|
mapLayers.value = layersCollection;
|
|
346
|
+
// Emit event to update layers
|
|
347
|
+
await nextTick(() => {
|
|
348
|
+
mapElement.value?.updateComplete.then(() => {
|
|
349
|
+
layersEvent.emit("layers:updated", mapLayers.value);
|
|
350
|
+
});
|
|
351
|
+
});
|
|
327
352
|
}
|
|
328
353
|
},
|
|
329
354
|
{ immediate: true },
|