@eodash/eodash 5.0.0-alpha.2.10 → 5.0.0-alpha.2.11
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/index.js +37 -18
- package/core/client/eodash.js +3 -10
- package/core/client/store/Actions.js +9 -33
- package/core/client/store/States.js +3 -0
- package/core/client/utils/createLayers.js +131 -0
- package/core/client/utils/eodashSTAC.js +149 -227
- package/core/client/utils/helpers.js +49 -69
- package/dist/client/{DashboardLayout-C_3q8Y10.js → DashboardLayout-D5c2wAGC.js} +2 -2
- package/dist/client/{DynamicWebComponent-IiTTLBt-.js → DynamicWebComponent-CBuMCUIj.js} +4 -4
- package/dist/client/{EodashDatePicker-DgC1lccp.js → EodashDatePicker-D0qdMMTE.js} +43 -43
- package/dist/client/EodashItemFilter-CTRnGRRS.js +10067 -0
- package/dist/client/EodashLayerControl-Bpm0BwcW.js +31499 -0
- package/dist/client/{EodashMap-C96D3LLv.js → EodashMap-DaMtQefq.js} +8326 -8311
- package/dist/client/{EodashMapBtns-DDtzV94u.js → EodashMapBtns-B5z8h8mr.js} +5 -5
- package/dist/client/{ExportState-CduS2mFs.js → ExportState-Bp3n6gba.js} +36 -36
- package/dist/client/{Footer-DHQcutCv.js → Footer-BROOTKhV.js} +1 -1
- package/dist/client/{Header-DC0y7rLK.js → Header-C_fKVTsg.js} +4 -4
- package/dist/client/{IframeWrapper-BK-10FbS.js → IframeWrapper-32Q3DBYr.js} +1 -1
- package/dist/client/{MobileLayout-BpLoMY4i.js → MobileLayout-TVGrYpNT.js} +6 -6
- package/dist/client/{PopUp-CNMCWL0z.js → PopUp-BJzmeeKG.js} +9 -9
- package/dist/client/{VImg-DT7eb8V-.js → VImg-BT4Vb0UT.js} +2 -2
- package/dist/client/{VMain-OenWyy46.js → VMain-BDVUXNEk.js} +2 -2
- package/dist/client/{VOverlay-x3UXpKhr.js → VOverlay-Ck_4Lxcb.js} +71 -71
- package/dist/client/{WidgetsContainer-qMUwtN0W.js → WidgetsContainer-DjjX_n1U.js} +5 -5
- package/dist/client/{asWebComponent-DQrnLsI2.js → asWebComponent-wn9bbgx9.js} +4117 -4117
- package/dist/client/{decoder-Cth6J7EK-CtUoHA6r.js → decoder-Cth6J7EK-CLlwAswr.js} +1 -1
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-CpNjL95t.js → forwardRefs--PLRH8zp.js} +1 -1
- package/dist/client/{helpers-KCSgmfim.js → helpers-CoqJPYdE.js} +206 -232
- package/dist/client/{index-DopVrUzM.js → index-Dt0NRXIq.js} +5 -5
- package/dist/client/{lerc-BgbQqdFI-D986ErVw.js → lerc-BgbQqdFI-CCpDWUne.js} +1 -1
- package/dist/client/{ssrBoot-DkjdOWvj.js → ssrBoot-DjZDIkG_.js} +1 -1
- package/dist/client/{transition-BtJHh7JK.js → transition-C8OQt_kp.js} +1 -1
- package/dist/node/cli.js +2 -2
- package/package.json +6 -3
- package/widgets/EodashDatePicker.vue +4 -3
- package/widgets/EodashItemFilter.vue +17 -12
- package/widgets/EodashLayerControl.vue +16 -0
- package/widgets/EodashMap.vue +46 -75
- package/dist/client/EodashItemFilter-DoWZGe6r.js +0 -7671
- package/dist/client/eox-jsonform-DCErgjhw.js +0 -17515
- package/dist/client/eox-layercontrol-D0Ht7Mag.js +0 -21298
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g,
|
|
1
|
+
import { g, bh as c, ab as h, ay as p, p as b, bi as S } from "./asWebComponent-wn9bbgx9.js";
|
|
2
2
|
const _ = b({
|
|
3
3
|
disabled: Boolean,
|
|
4
4
|
group: Boolean,
|
|
@@ -54,8 +54,8 @@ function s(o, d, i) {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
return () => {
|
|
57
|
-
const e = n.group ? c :
|
|
58
|
-
return
|
|
57
|
+
const e = n.group ? c : h;
|
|
58
|
+
return p(e, {
|
|
59
59
|
name: n.disabled ? "" : o,
|
|
60
60
|
css: !n.disabled,
|
|
61
61
|
...n.group ? void 0 : {
|
|
@@ -83,8 +83,8 @@ function m(o, d) {
|
|
|
83
83
|
let {
|
|
84
84
|
slots: a
|
|
85
85
|
} = r;
|
|
86
|
-
const t = n.group ? c :
|
|
87
|
-
return () =>
|
|
86
|
+
const t = n.group ? c : h;
|
|
87
|
+
return () => p(t, {
|
|
88
88
|
name: n.disabled ? "" : o,
|
|
89
89
|
css: !n.disabled,
|
|
90
90
|
// mode: props.mode, // TODO: vuejs/vue-next#3104
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as tA } from "./pako.esm-CB1uQYY0-DB0PYm1P.js";
|
|
2
|
-
import { k as sA, $ as gA, L as rA } from "./EodashMap-
|
|
2
|
+
import { k as sA, $ as gA, L as rA } from "./EodashMap-DaMtQefq.js";
|
|
3
3
|
import { g as DA } from "./basedecoder-DHcBySSe-BmCFNFnw.js";
|
|
4
4
|
var iA = { exports: {} };
|
|
5
5
|
(function(W) {
|
package/dist/node/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createLogger as P,defineConfig as C,searchForWorkspaceRoot as x,createServer as k,preview as S,build as F}from"vite";import{readFileSync as U,existsSync as u}from"fs";import t from"path";import{Command as E}from"commander";import{readFile as
|
|
2
|
+
import{createLogger as P,defineConfig as C,searchForWorkspaceRoot as x,createServer as k,preview as S,build as F}from"vite";import{readFileSync as U,existsSync as u}from"fs";import t from"path";import{Command as E}from"commander";import{fileURLToPath as W}from"url";import{readFile as I,writeFile as T,rm as $,cp as L}from"fs/promises";import N from"@vitejs/plugin-vue";import O,{transformAssetUrls as A}from"vite-plugin-vuetify";const s=b(process.cwd()),h=new E("eodash"),H=JSON.parse(U(t.join(s,"package.json"),"utf-8"));h.version(H.version,"-v, --version","output the current version"),h.option("--publicDir <path>","path to statically served assets folder").option("--no-publicDir","stop serving static assets").option("--outDir <path>","minified output folder").option("-e, --entryPoint <path>","file exporting `createEodash`").option("-w, --widgets <path>","folder that contains vue components as internal widgets").option("--cacheDir <path>","cache folder").option("-r, --runtime <path>","file exporting eodash client runtime config").option("-b, --base <path>","base public path").option("-p, --port <port>","serving port").option("-o, --open","open default browser when the server starts").option("-c, --config <path>","path to eodash server and build configuration file").option("--host [IP address]","specify which IP addresses the server should listen on").option("-l, --lib","builds eodash as a web component library").option("--no-lib","builds eodash as an SPA").option("--no-host","do not expose server to the network").parse(process.argv);const i=await J(h.opts(),process.argv?.[2]),c=b(),R=i.publicDir?t.resolve(s,i.publicDir):t.join(s,"./public"),m=t.join(s,"/src"),l=i.runtime?t.resolve(s,i.runtime):t.join(m,"./runtime.js"),g=i.entryPoint?t.resolve(s,i.entryPoint):t.join(m,"/main.js"),w=i.widgets?t.resolve(s,i.widgets):t.join(m,"widgets"),j=t.join(s,"/.eodash"),f=i.outDir?t.resolve(s,i.outDir):t.join(j,"/dist"),z=i.cacheDir?t.resolve(s,i.cacheDir):t.join(j,"cache"),v=P(void 0,{prefix:"[eodash]"});async function J(e,n){let a=e.config?t.resolve(s,e.config):t.join(s,"eodash.config.js"),o={};return u(a)?o=await import(a).then(r=>r.default instanceof Function?r.default():r.default).catch(r=>{console.error(r)}):a=null,{base:e.base??o?.base,port:Number(e.port??o?.[n]?.port),host:e.host??o?.[n]?.host,open:e.open??o?.[n]?.open,cacheDir:e.cacheDir??o?.cacheDir,entryPoint:e.entryPoint??o?.entryPoint,outDir:e.outDir??o?.outDir,publicDir:e.publicDir??o?.publicDir,runtime:e.runtime??o?.runtime,widgets:e.widgets??o?.widgets,lib:e.lib??o?.lib}}function b(e=import.meta.dirname??t.dirname(W(import.meta.url))){if(e?.split("/").length)return u(t.resolve(e,"package.json"))?e:b(t.resolve(e,".."));throw new Error("no package root found from "+e)}const y=`
|
|
3
3
|
<!DOCTYPE html>
|
|
4
4
|
<html lang="en">
|
|
5
5
|
|
|
@@ -17,4 +17,4 @@ ${i.lib?`<eo-dash style="height:100dvh;"/>
|
|
|
17
17
|
<script type="module" src="${t.resolve(`/@fs/${c}`,"core/client/render.js")}"><\/script>
|
|
18
18
|
`}
|
|
19
19
|
</body>
|
|
20
|
-
</html>`,D=C(({mode:e,command:n})=>({base:i.base??"",cacheDir:
|
|
20
|
+
</html>`,D=C(({mode:e,command:n})=>({base:i.base??"",cacheDir:z,plugins:[N({customElement:!1,template:{transformAssetUrls:A,compilerOptions:{isCustomElement:a=>!a.includes("v-")&&a.includes("-")}}}),O({autoImport:!0}),e==="development"&&{name:"inject-html",configureServer:M}],customLogger:v,define:{"process.env":{}},resolve:{alias:{"@":t.join(c,"core/client"),"^":t.join(c,"widgets"),"user:config":g,"user:widgets":w},extensions:[".js",".json",".jsx",".mjs",".ts",".tsx",".vue"]},server:{warmup:{clientFiles:[t.join(c,"core/client/**")]},port:i.port??3e3,open:i.open,fs:{allow:[x(process.cwd())]},host:i.host},root:c,optimizeDeps:e==="development"?{include:["webfontloader","vuetify","vue","pinia","stac-js","urijs"],noDiscovery:!0}:{},publicDir:i.publicDir===!1?!1:R,build:{lib:i.lib&&n==="build"&&{entry:t.join(c,"core/client/asWebComponent.js"),fileName:"eo-dash",formats:["es"],name:"@eodash/eodash"},outDir:f,emptyOutDir:!0,rollupOptions:i.lib&&n==="build"?{input:t.join(c,"core/client/asWebComponent.js")}:void 0,target:"esnext"}}));async function M(e){e.watcher.add([g,l,t.join(w,"**/*.vue")]);let n="";const a=v.info;return v.info=(o,r)=>{if(o.includes("core")){const d=o.split("/")[0].split(" ");d.pop();const p=d.join(" ")+" "+n.replace(s,"");return a(p,r)}return a(o,r)},e.watcher.on("change",async o=>{n=o,o===l&&e.hot.send({type:"full-reload",path:o})}),()=>{e.middlewares.use(async(o,r,d)=>{if(o.originalUrl==="/@fs/config.js"||o.originalUrl==="/config.js"){r.statusCode=200,r.setHeader("Content-Type","text/javascript"),u(l)&&await I(l).then(p=>{r.write(p)}),r.end();return}if(o.url?.endsWith(".html")){r.statusCode=200,r.setHeader("Content-Type","text/html");const p=await e.transformIndexHtml(o.url,y,o.originalUrl);r.end(p);return}d()})}}const Y=async()=>{const e=await k(await D({mode:"development",command:"serve"}));await e.listen(),e.printUrls(),e.bindCLIShortcuts({print:!0})},B=async()=>{const e=async()=>{const n=await D({mode:"production",command:"build"});await F(n),u(l)&&await L(l,t.join(f,"config.js"),{recursive:!0}).catch(a=>{console.error(a)})};if(i.lib)await e();else{const n=t.join(c,"/index.html");await T(n,y).then(async()=>{await e(),await $(n).catch(()=>{console.error("failed to remove index.html")})})}};async function G(){(await S({root:s,base:i.base??"",preview:{port:isNaN(i.port)?8080:i.port,open:i.open,host:i.host},build:{outDir:f}})).printUrls()}const K=process.argv?.[2];(async()=>{switch(K){case"dev":await Y();break;case"build":await B();break;case"preview":await G();break;default:console.error("command not found");break}})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eodash/eodash",
|
|
3
|
-
"version": "5.0.0-alpha.2.
|
|
3
|
+
"version": "5.0.0-alpha.2.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./core/client/types.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"docs:generate": "typedoc --options typedoc.config.json"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@eox/itemfilter": "^0.
|
|
49
|
+
"@eox/itemfilter": "^1.0.0",
|
|
50
50
|
"@eox/jsonform": "^0.8.1",
|
|
51
|
-
"@eox/layercontrol": "0.
|
|
51
|
+
"@eox/layercontrol": "^0.18.1-dev.1721833788.0",
|
|
52
52
|
"@eox/layout": "^0.1.0",
|
|
53
53
|
"@eox/map": "1.9.3-ol-9.2.5-dev.1719634408469.0",
|
|
54
54
|
"@eox/stacinfo": "^0.3.3",
|
|
@@ -91,6 +91,9 @@
|
|
|
91
91
|
"vitest": "^1.6.0",
|
|
92
92
|
"vue-tsc": "2.0.22"
|
|
93
93
|
},
|
|
94
|
+
"engines": {
|
|
95
|
+
"node": ">=20.15.1"
|
|
96
|
+
},
|
|
94
97
|
"bin": {
|
|
95
98
|
"eodash": "./dist/node/cli.js"
|
|
96
99
|
}
|
|
@@ -45,6 +45,7 @@ import { useSTAcStore } from "@/store/stac";
|
|
|
45
45
|
import { datetime } from "@/store/States";
|
|
46
46
|
import { mdiRayStartArrow, mdiRayEndArrow } from "@mdi/js";
|
|
47
47
|
import { extractCollectionUrls } from "@/utils/helpers";
|
|
48
|
+
import axios from "axios";
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
51
|
* @param {boolean} reverse
|
|
@@ -131,9 +132,9 @@ onMounted(() => {
|
|
|
131
132
|
"#D55E00",
|
|
132
133
|
];
|
|
133
134
|
for (let idx = 0; idx < collectionUrls.length; idx++) {
|
|
134
|
-
const stacCollection = await
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
const stacCollection = await axios
|
|
136
|
+
.get(collectionUrls[idx])
|
|
137
|
+
.then((resp) => resp.data);
|
|
137
138
|
const dates = stacCollection.links
|
|
138
139
|
.filter(
|
|
139
140
|
(/** @type {{ rel: string; datetime: string }} */ item) =>
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<eox-itemfilter
|
|
2
|
+
<eox-itemfilter
|
|
3
|
+
class="fill-height"
|
|
4
|
+
v-bind="config"
|
|
5
|
+
ref="eoxItemFilter"
|
|
6
|
+
style="overflow: auto"
|
|
7
|
+
@select="onSelect"
|
|
8
|
+
>
|
|
3
9
|
<h4 slot="filterstitle" style="margin: 14px 8px">{{ filtersTitle }}</h4>
|
|
4
10
|
|
|
5
11
|
<h4 slot="resultstitle" style="margin: 14px 8px">{{ resultsTitle }}</h4>
|
|
@@ -53,7 +59,12 @@ const props = defineProps({
|
|
|
53
59
|
],
|
|
54
60
|
},
|
|
55
61
|
});
|
|
56
|
-
|
|
62
|
+
/** @param {any} evt*/
|
|
63
|
+
const onSelect = async (evt) => {
|
|
64
|
+
const item = /** @type {import('stac-ts').StacLink} */ evt.detail;
|
|
65
|
+
await store.loadSelectedSTAC(item.href);
|
|
66
|
+
console.log(item, store.selectedStac);
|
|
67
|
+
};
|
|
57
68
|
const config = {
|
|
58
69
|
titleProperty: props.titleProperty,
|
|
59
70
|
filterProperties: props.filterProperties,
|
|
@@ -81,15 +92,9 @@ onMounted(() => {
|
|
|
81
92
|
`;
|
|
82
93
|
eoxItemFilter.value?.shadowRoot?.appendChild(style);
|
|
83
94
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
);
|
|
88
|
-
/** @type {any} */ (eoxItemFilter.value).config.onSelect =
|
|
89
|
-
/** @param {import('stac-ts').StacLink} item */
|
|
90
|
-
async (item) => {
|
|
91
|
-
await store.loadSelectedSTAC(item.href);
|
|
92
|
-
console.log(item, store.selectedStac);
|
|
93
|
-
};
|
|
95
|
+
// Only list child elements in list
|
|
96
|
+
const items = store.stac?.filter((item) => item.rel === "child");
|
|
97
|
+
/** @type {any} */
|
|
98
|
+
(eoxItemFilter.value).items = items;
|
|
94
99
|
});
|
|
95
100
|
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<eox-layercontrol ref="eoxLayercontrol" class="pa-4" />
|
|
3
|
+
</template>
|
|
4
|
+
<script setup>
|
|
5
|
+
import "@eox/layercontrol";
|
|
6
|
+
import "@eox/jsonform";
|
|
7
|
+
import { onMounted, ref } from "vue";
|
|
8
|
+
import { mapEl } from "@/store/States";
|
|
9
|
+
/** @type { import("vue").Ref<HTMLElement & Record<string,any> | null>} */
|
|
10
|
+
const eoxLayercontrol = ref(null);
|
|
11
|
+
|
|
12
|
+
onMounted(() => {
|
|
13
|
+
/** @type{ HTMLElement & Record<string,any> }*/
|
|
14
|
+
(eoxLayercontrol.value).for = mapEl.value;
|
|
15
|
+
});
|
|
16
|
+
</script>
|
package/widgets/EodashMap.vue
CHANGED
|
@@ -7,22 +7,16 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
<script setup>
|
|
9
9
|
import { transformExtent } from "ol/proj";
|
|
10
|
-
import {
|
|
11
|
-
import { toAbsolute } from "stac-js/src/http.js";
|
|
10
|
+
import { onMounted, onUnmounted, reactive, ref, watch } from "vue";
|
|
12
11
|
import { EodashCollection } from "@/utils/eodashSTAC";
|
|
13
|
-
import { extractCollectionUrls } from "@/utils/helpers";
|
|
14
|
-
import {
|
|
15
|
-
import { datetime, mapPosition } from "@/store/States";
|
|
12
|
+
import { extractCollectionUrls, uid } from "@/utils/helpers";
|
|
13
|
+
import { currentUrl, datetime, mapEl, mapPosition } from "@/store/States";
|
|
16
14
|
import { storeToRefs } from "pinia";
|
|
17
15
|
import { useSTAcStore } from "@/store/stac";
|
|
18
16
|
import "@eox/map";
|
|
19
17
|
import "@eox/map/dist/eox-map-advanced-layers-and-sources.js";
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
inject(eodashKey)
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
/** @type {import("vue").Ref<(HTMLElement & Record<string,unknown>) | null>} */
|
|
19
|
+
/** @type {import("vue").Ref<(HTMLElement & Record<string,any>) | null>} */
|
|
26
20
|
const eoxMap = ref(null);
|
|
27
21
|
|
|
28
22
|
const eoxMapConfig = reactive({
|
|
@@ -70,11 +64,6 @@ const handleMoveEnd = (evt) => {
|
|
|
70
64
|
const map = /** @type {import("openlayers").Map | undefined} */ (
|
|
71
65
|
/** @type {any} */ (evt).map
|
|
72
66
|
);
|
|
73
|
-
/*
|
|
74
|
-
const currentProj = map?.getView().getProjection();
|
|
75
|
-
const transFunc = getTransform(currentProj?.getCode(), 'EPSG:4326');
|
|
76
|
-
const [x, y] = transFunc(map?.getView().getCenter() ?? [0, 0], undefined, undefined);
|
|
77
|
-
*/
|
|
78
67
|
const [x, y] = map?.getView().getCenter() ?? [0, 0];
|
|
79
68
|
const z = map?.getView().getZoom();
|
|
80
69
|
if (!Number.isNaN(x) && !Number.isNaN(y) && !Number.isNaN(z)) {
|
|
@@ -85,6 +74,8 @@ const handleMoveEnd = (evt) => {
|
|
|
85
74
|
const store = useSTAcStore();
|
|
86
75
|
|
|
87
76
|
onMounted(() => {
|
|
77
|
+
mapEl.value = /** @type {HTMLElement & Record<string,any>} */ (eoxMap.value);
|
|
78
|
+
|
|
88
79
|
/** @type {import('ol/Map').default} */
|
|
89
80
|
(eoxMap.value?.map)?.on("moveend", handleMoveEnd);
|
|
90
81
|
|
|
@@ -94,24 +85,15 @@ onMounted(() => {
|
|
|
94
85
|
[selectedStac, datetime],
|
|
95
86
|
async ([updatedStac, updatedTime], [previousSTAC, _previousTime]) => {
|
|
96
87
|
if (updatedStac) {
|
|
97
|
-
const parentCollUrl = toAbsolute(
|
|
98
|
-
`./${updatedStac.id}/collection.json`,
|
|
99
|
-
eodashConfig.stacEndpoint,
|
|
100
|
-
);
|
|
101
88
|
const collectionUrls = extractCollectionUrls(
|
|
102
89
|
selectedStac.value,
|
|
103
|
-
|
|
90
|
+
currentUrl.value,
|
|
104
91
|
);
|
|
105
|
-
|
|
106
|
-
const eodashCollections =
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const uid = function () {
|
|
111
|
-
return (
|
|
112
|
-
Date.now().toString(36) + Math.random().toString(36).substring(2)
|
|
113
|
-
);
|
|
114
|
-
};
|
|
92
|
+
|
|
93
|
+
const eodashCollections = collectionUrls.map(
|
|
94
|
+
(cu) => new EodashCollection(cu),
|
|
95
|
+
);
|
|
96
|
+
|
|
115
97
|
const layersCollection = [];
|
|
116
98
|
const dataLayers = {
|
|
117
99
|
type: "Group",
|
|
@@ -120,10 +102,10 @@ onMounted(() => {
|
|
|
120
102
|
title: "Analysis Layers",
|
|
121
103
|
layerControlExpand: true,
|
|
122
104
|
},
|
|
123
|
-
layers: /** @type {
|
|
105
|
+
layers: /** @type {Record<string,any>[]}*/ ([]),
|
|
124
106
|
};
|
|
125
|
-
|
|
126
|
-
|
|
107
|
+
|
|
108
|
+
for (const ec of eodashCollections) {
|
|
127
109
|
let layers;
|
|
128
110
|
if (updatedTime) {
|
|
129
111
|
layers = await ec.createLayersJson(new Date(updatedTime));
|
|
@@ -136,55 +118,39 @@ onMounted(() => {
|
|
|
136
118
|
}
|
|
137
119
|
// Add expand to all analysis layers
|
|
138
120
|
dataLayers.layers.forEach((dl) => {
|
|
139
|
-
// @ts-expect-error no type definition for eox-map config
|
|
140
121
|
dl.properties.layerControlExpand = true;
|
|
141
|
-
// @ts-expect-error no type definition for eox-map config
|
|
142
122
|
dl.properties.layerControlToolsExpand = true;
|
|
143
123
|
});
|
|
144
124
|
|
|
145
125
|
layersCollection.push(dataLayers);
|
|
146
|
-
|
|
147
|
-
// Probably best also to introduce background and overlay groups
|
|
148
|
-
// For now adding OSM as background
|
|
149
|
-
const indicator = new EodashCollection(parentCollUrl);
|
|
126
|
+
const indicator = new EodashCollection(currentUrl.value);
|
|
150
127
|
const indicatorLayers = await indicator.buildJsonArray(
|
|
151
128
|
// @ts-expect-error we pass a collection instead of an item, we want to reuse the layer extraction logic
|
|
152
129
|
selectedStac.value,
|
|
153
|
-
|
|
154
|
-
|
|
130
|
+
currentUrl.value,
|
|
131
|
+
selectedStac.value?.title ?? "",
|
|
132
|
+
selectedStac.value?.endpointtype ?? false,
|
|
155
133
|
);
|
|
134
|
+
|
|
156
135
|
const baseLayers = {
|
|
157
136
|
type: "Group",
|
|
158
137
|
properties: {
|
|
159
138
|
id: uid(),
|
|
160
139
|
title: "Base Layers",
|
|
161
140
|
},
|
|
162
|
-
layers: /** @type {
|
|
163
|
-
};
|
|
164
|
-
const overlayLayers = {
|
|
165
|
-
type: "Group",
|
|
166
|
-
properties: {
|
|
167
|
-
id: uid(),
|
|
168
|
-
title: "Overlay Layers",
|
|
169
|
-
},
|
|
170
|
-
layers: /** @type {object[]}*/ ([]),
|
|
141
|
+
layers: /** @type {Record<string,any>[]}*/ ([]),
|
|
171
142
|
};
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
143
|
+
|
|
144
|
+
const indicatorBaseLayers = indicatorLayers.filter(
|
|
145
|
+
(l) => l.properties.group === "baselayer",
|
|
146
|
+
);
|
|
147
|
+
if (indicatorBaseLayers.length) {
|
|
148
|
+
baseLayers.layers.push(...indicatorBaseLayers);
|
|
149
|
+
|
|
179
150
|
// Add exclusive to baselayers and make sure only one is selected
|
|
180
151
|
baseLayers.layers.forEach((bl) => {
|
|
181
|
-
// @ts-expect-error no type definition for eox-map config
|
|
182
152
|
bl.properties.layerControlExclusive = true;
|
|
183
153
|
});
|
|
184
|
-
overlayLayers.layers.push(
|
|
185
|
-
// @ts-expect-error group is added by the buildJsonArray
|
|
186
|
-
...indicatorLayers.filter((l) => l.properties.group === "overlay"),
|
|
187
|
-
);
|
|
188
154
|
} else {
|
|
189
155
|
// Default to some baselayer
|
|
190
156
|
baseLayers.layers.push({
|
|
@@ -192,28 +158,34 @@ onMounted(() => {
|
|
|
192
158
|
properties: {
|
|
193
159
|
id: "osm",
|
|
194
160
|
title: "Background",
|
|
161
|
+
layerControlExclusive: true,
|
|
195
162
|
},
|
|
196
163
|
source: {
|
|
197
164
|
type: "OSM",
|
|
198
165
|
},
|
|
199
166
|
});
|
|
200
167
|
}
|
|
201
|
-
|
|
168
|
+
|
|
169
|
+
if (baseLayers.layers.length) {
|
|
202
170
|
layersCollection.push(baseLayers);
|
|
203
171
|
}
|
|
204
|
-
if (overlayLayers.layers.length > 0) {
|
|
205
|
-
layersCollection.unshift(overlayLayers);
|
|
206
|
-
}
|
|
207
172
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
173
|
+
const overlayLayers = {
|
|
174
|
+
type: "Group",
|
|
175
|
+
properties: {
|
|
176
|
+
id: uid(),
|
|
177
|
+
title: "Overlay Layers",
|
|
178
|
+
},
|
|
179
|
+
layers: /** @type {Record<string,any>[]}*/ ([]),
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const indicatorOverlays = indicatorLayers.filter(
|
|
183
|
+
(l) => l.properties.group === "overlay",
|
|
214
184
|
);
|
|
215
|
-
(
|
|
216
|
-
|
|
185
|
+
if (indicatorOverlays.length) {
|
|
186
|
+
overlayLayers.layers.push(...indicatorOverlays);
|
|
187
|
+
layersCollection.unshift(overlayLayers);
|
|
188
|
+
}
|
|
217
189
|
|
|
218
190
|
/** @type {any} */
|
|
219
191
|
(eoxMap.value).layers = layersCollection;
|
|
@@ -236,7 +208,6 @@ onMounted(() => {
|
|
|
236
208
|
const reprojExtent = transformExtent(
|
|
237
209
|
sanitizedExtent,
|
|
238
210
|
"EPSG:4326",
|
|
239
|
-
// @ts-expect-error we should expect to have the view here
|
|
240
211
|
eoxMap.value?.map?.getView().getProjection(),
|
|
241
212
|
);
|
|
242
213
|
/** @type {any} */
|