@eodash/eodash 5.7.0 → 5.8.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/components/EodashOverlay.vue +27 -4
- package/core/client/composables/DefineEodash.js +0 -1
- package/core/client/composables/DefineWidgets.js +3 -1
- package/core/client/eodashSTAC/EodashCollection.js +87 -24
- package/core/client/eodashSTAC/cql.js +64 -0
- package/core/client/eodashSTAC/createLayers.js +353 -187
- package/core/client/eodashSTAC/helpers.js +694 -110
- package/core/client/eodashSTAC/mosaic.js +422 -0
- package/core/client/plugins/axios.js +31 -1
- package/core/client/store/actions.js +1 -1
- package/core/client/store/stac.js +54 -4
- package/core/client/store/states.js +20 -2
- package/core/client/types.ts +152 -28
- package/core/client/utils/bands-editor/exampleSchema.json +50 -50
- package/core/client/utils/states.js +10 -0
- package/dist/client/{DashboardLayout-kRsmsNW5.js → DashboardLayout-DEs4f_Vy.js} +2 -2
- package/dist/client/{DynamicWebComponent-CnKhYo0K.js → DynamicWebComponent-PvnV88BA.js} +1 -1
- package/dist/client/EodashChart-D-3AGKZY.js +260 -0
- package/dist/client/{EodashDatePicker-CMPDT-ce.js → EodashDatePicker-Dm_goZzs.js} +3 -3
- package/dist/client/{EodashItemFilter-BpdA8QQa.js → EodashItemFilter-CJy3zYzD.js} +2 -1
- package/dist/client/{EodashLayerControl-BHpDA4_0.js → EodashLayerControl-rL8UnpkA.js} +55 -33
- package/dist/client/{EodashLayoutSwitcher-B1fRUt7G.js → EodashLayoutSwitcher-ZRlESI9O.js} +3 -3
- package/dist/client/{EodashMapBtns-Cpned0tc.js → EodashMapBtns-CG7u2Aq8.js} +227 -112
- package/dist/client/EodashStacInfo-CJhhxthD.js +169 -0
- package/dist/client/{EodashTools-1zHz26gv.js → EodashTools-CWyK8QJT.js} +4 -4
- package/dist/client/{ExportState-DbOm8hBI.js → ExportState-BXhy5TOU.js} +20 -174
- package/dist/client/{Footer-BKg-VVkj.js → Footer-DZPvnhcT.js} +1 -1
- package/dist/client/{Header-DCrwCvmY.js → Header-CiGsDE_a.js} +2 -2
- package/dist/client/{MobileLayout-vWSHpluo.js → MobileLayout-BJHW7x5V.js} +2 -2
- package/dist/client/{PopUp-9uimfK49.js → PopUp-7_XnhvCc.js} +4 -168
- package/dist/client/{ProcessList-CTTIZa06.js → ProcessList-LL_UCbvc.js} +5 -5
- package/dist/client/VDivider-DWYM0WUr.js +168 -0
- package/dist/client/{VImg-CrmB76ZY.js → VImg-B75dgw2K.js} +2 -2
- package/dist/client/{VMain-OKZNpcEG.js → VMain-DvMmOL4f.js} +1 -1
- package/dist/client/{VTooltip-CJw2FyWk.js → VTooltip-ClWHUmWL.js} +2 -2
- package/dist/client/{WidgetsContainer-BaWOnE5R.js → WidgetsContainer-BqaWs4ch.js} +1 -1
- package/dist/client/{asWebComponent-BHWpMuE3.js → asWebComponent-IZanwL-A.js} +677 -379
- package/dist/client/{async-DSKj6g1f.js → async-CiNIOBVz.js} +31 -29
- package/dist/client/{create-layers-config-CBoYedqB.js → create-layers-config-3S3y_kZg.js} +17 -17
- package/dist/client/dialog-transition-c4ZSnzac.js +170 -0
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{forwardRefs-DH51zPUr.js → forwardRefs-B-c1_6yo.js} +8 -87
- package/dist/client/{handling-BrcDDlgS.js → handling-NvY8Csry.js} +3 -4
- package/dist/client/{helpers-DjZVl_WF.js → helpers-BFuh19CP.js} +1094 -194
- package/dist/client/{index-1JKE68n3.js → index-1wMAyuNL.js} +219 -67
- package/dist/client/{index-CSG_JoOA.js → index-B8jGJSTA.js} +62 -56
- package/dist/client/{index-Cu3-13Xg.js → index-BKQQJkhy.js} +167 -61
- package/dist/client/index-D0jUyol8.js +3167 -0
- package/dist/client/{index-CUjl-ZsI.js → index-KGxz5Egv.js} +2 -2
- package/dist/client/mosaic-vHvSuih6.js +459 -0
- package/dist/client/templates.js +251 -121
- package/dist/client/{transition-OHcz5Qq1.js → transition-BkyUsZh_.js} +1 -1
- package/dist/node/cli.js +5 -5
- package/dist/node/types.d.ts +4 -0
- package/dist/types/core/client/composables/DefineEodash.d.ts +1 -1
- package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +57 -25
- package/dist/types/core/client/eodashSTAC/cql.d.ts +15 -0
- package/dist/types/core/client/eodashSTAC/createLayers.d.ts +42 -23
- package/dist/types/core/client/eodashSTAC/helpers.d.ts +118 -19
- package/dist/types/core/client/eodashSTAC/mosaic.d.ts +56 -0
- package/dist/types/core/client/store/stac.d.ts +38 -8
- package/dist/types/core/client/store/states.d.ts +24 -2
- package/dist/types/core/client/types.d.ts +128 -24
- package/dist/types/core/client/utils/states.d.ts +12 -0
- package/dist/types/templates/baseConfig.d.ts +1 -100
- package/dist/types/templates/compare.d.ts +32 -3
- package/dist/types/templates/expert.d.ts +18 -0
- package/dist/types/templates/explore.d.ts +10 -1
- package/dist/types/templates/lite.d.ts +11 -0
- package/dist/types/widgets/EodashChart.vue.d.ts +5 -3
- package/dist/types/widgets/EodashItemCatalog/index.vue.d.ts +129 -2
- package/dist/types/widgets/EodashItemCatalog/methods/filters.d.ts +28 -6
- package/dist/types/widgets/EodashItemCatalog/methods/handlers.d.ts +17 -4
- package/dist/types/widgets/EodashItemCatalog/methods/map.d.ts +16 -4
- package/dist/types/widgets/EodashLayerControl.vue.d.ts +35 -16
- package/dist/types/widgets/EodashMap/EodashMapBtns.vue.d.ts +14 -10
- package/dist/types/widgets/EodashMap/index.vue.d.ts +86 -37
- package/dist/types/widgets/EodashMap/methods/create-layers-config.d.ts +1 -1
- package/dist/types/widgets/EodashMap/methods/index.d.ts +5 -1
- package/dist/types/widgets/EodashMap/methods/use-map-loading.d.ts +1 -0
- package/dist/types/widgets/EodashProcess/index.vue.d.ts +5 -3
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.d.ts +1 -1
- package/dist/types/widgets/EodashProcess/states.d.ts +1 -1
- package/dist/types/widgets/EodashStacInfo.vue.d.ts +20 -0
- package/dist/types/widgets/EodashTimeSlider/index.vue.d.ts +20 -0
- package/dist/types/widgets/EodashTimeSlider/methods/index.d.ts +3 -8
- package/dist/types/widgets/EodashTimeSlider/types.d.ts +6 -16
- package/dist/types/widgets/EodashTools.vue.d.ts +5 -5
- package/package.json +34 -34
- package/templates/baseConfig.js +37 -6
- package/templates/compare.js +61 -7
- package/templates/expert.js +24 -2
- package/templates/explore.js +12 -5
- package/templates/lite.js +13 -0
- package/widgets/EodashChart.vue +162 -21
- package/widgets/EodashItemCatalog/index.vue +363 -35
- package/widgets/EodashItemCatalog/methods/filters.js +134 -70
- package/widgets/EodashItemCatalog/methods/handlers.js +113 -19
- package/widgets/EodashItemCatalog/methods/map.js +141 -28
- package/widgets/EodashLayerControl.vue +51 -25
- package/widgets/EodashMap/EodashMapBtns.vue +109 -48
- package/widgets/EodashMap/index.vue +91 -105
- package/widgets/EodashMap/methods/btns.js +64 -31
- package/widgets/EodashMap/methods/create-layers-config.js +16 -16
- package/widgets/EodashMap/methods/index.js +71 -8
- package/widgets/EodashMap/methods/use-map-loading.js +58 -0
- package/widgets/EodashProcess/index.vue +136 -16
- package/widgets/EodashProcess/methods/composables.js +13 -0
- package/widgets/EodashProcess/methods/outputs.js +0 -1
- package/widgets/EodashProcess/methods/utils.js +29 -27
- package/widgets/EodashProcess/states.js +1 -1
- package/widgets/EodashStacInfo.vue +64 -2
- package/widgets/EodashTimeSlider/index.vue +58 -2
- package/widgets/EodashTimeSlider/methods/index.js +5 -48
- package/widgets/EodashTimeSlider/types.ts +7 -17
- package/widgets/ExportState.vue +13 -4
- package/dist/client/EodashChart-CLDqE93C.js +0 -144
- package/dist/client/EodashStacInfo-BQspAHKH.js +0 -107
- package/dist/client/index-5Jhsa8Xe.js +0 -570
|
@@ -80,6 +80,7 @@ import {
|
|
|
80
80
|
compareIndicator,
|
|
81
81
|
poi,
|
|
82
82
|
isGlobe,
|
|
83
|
+
tooltipAdapter,
|
|
83
84
|
} from "@/store/states";
|
|
84
85
|
import { storeToRefs } from "pinia";
|
|
85
86
|
import { useSTAcStore } from "@/store/stac";
|
|
@@ -93,6 +94,7 @@ import {
|
|
|
93
94
|
import {
|
|
94
95
|
useHandleMapMoveEnd,
|
|
95
96
|
useInitMap,
|
|
97
|
+
useMapLoading,
|
|
96
98
|
useUpdateTooltipProperties,
|
|
97
99
|
} from "^/EodashMap/methods";
|
|
98
100
|
import { inAndOut } from "ol/easing.js";
|
|
@@ -100,42 +102,73 @@ import mustache from "mustache";
|
|
|
100
102
|
import EodashMapBtns from "^/EodashMap/EodashMapBtns.vue";
|
|
101
103
|
|
|
102
104
|
const props = defineProps({
|
|
105
|
+
baseLayers: {
|
|
106
|
+
/** @type {import("vue").PropType<import("@eox/map").EoxLayer[]>} */
|
|
107
|
+
type: Array,
|
|
108
|
+
default: () => [
|
|
109
|
+
{
|
|
110
|
+
type: "Tile",
|
|
111
|
+
source: { type: "OSM" },
|
|
112
|
+
properties: {
|
|
113
|
+
id: "osm",
|
|
114
|
+
title: "Background",
|
|
115
|
+
layerControlExclusive: true,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
103
120
|
enableCompare: {
|
|
104
121
|
type: Boolean,
|
|
105
122
|
default: false,
|
|
106
123
|
},
|
|
107
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* Initial map center as [lon, lat]; falls back to the last stored map position.
|
|
126
|
+
* @default [15, 48]
|
|
127
|
+
*/
|
|
108
128
|
center: {
|
|
109
|
-
|
|
110
|
-
|
|
129
|
+
type: /** @type {import("vue").PropType<[number, number]>} */ (
|
|
130
|
+
/** @type {unknown} */ (Array)
|
|
131
|
+
),
|
|
111
132
|
default: () => [mapPosition.value?.[0] ?? 15, mapPosition.value?.[1] ?? 48],
|
|
112
133
|
},
|
|
134
|
+
/**
|
|
135
|
+
* Initial zoom level; falls back to the last stored map position.
|
|
136
|
+
* @default 4
|
|
137
|
+
*/
|
|
113
138
|
zoom: {
|
|
114
139
|
type: Number,
|
|
115
140
|
default: mapPosition.value?.[2] ?? 4,
|
|
116
141
|
},
|
|
142
|
+
/** Fly to the selected collection's spatial extent on selection. */
|
|
117
143
|
zoomToExtent: {
|
|
118
144
|
type: Boolean,
|
|
119
145
|
default: true,
|
|
120
146
|
},
|
|
147
|
+
/** Show live cursor coordinates as a fixed overlay at the bottom-left of the map. */
|
|
121
148
|
enableCursorCoordinates: {
|
|
122
149
|
type: Boolean,
|
|
123
150
|
default: true,
|
|
124
151
|
},
|
|
152
|
+
/** Show an OpenLayers scale-line control at the bottom-left of the map. */
|
|
125
153
|
enableScaleLine: {
|
|
126
154
|
type: Boolean,
|
|
127
155
|
default: true,
|
|
128
156
|
},
|
|
157
|
+
/** Grid position of the floating button toolbar. `x` accepts responsive `"mobile/tablet/desktop"` column notation. */
|
|
129
158
|
btnsPosition: {
|
|
130
|
-
type:
|
|
159
|
+
type: /** @type {import("vue").PropType<{ x: string | number; y: number; gap: number }>} */ (
|
|
160
|
+
Object
|
|
161
|
+
),
|
|
131
162
|
default: () => ({
|
|
132
163
|
x: "12/9/10",
|
|
133
164
|
y: 1,
|
|
134
165
|
gap: 16,
|
|
135
166
|
}),
|
|
136
167
|
},
|
|
168
|
+
/** Toolbar feature flags; set any flag to `false` to hide the corresponding button. */
|
|
137
169
|
btns: {
|
|
138
|
-
|
|
170
|
+
type: /**
|
|
171
|
+
* @type {import("vue").PropType<{
|
|
139
172
|
* enableExportMap?: boolean;
|
|
140
173
|
* enableChangeProjection?: boolean;
|
|
141
174
|
* enableBackToPOIs?: boolean;
|
|
@@ -143,14 +176,14 @@ const props = defineProps({
|
|
|
143
176
|
* searchParams?: object;
|
|
144
177
|
* enableZoom?: boolean;
|
|
145
178
|
* enableGlobe?: boolean;
|
|
179
|
+
* enableMosaic?: boolean;
|
|
146
180
|
* enableFeedback?: boolean;
|
|
147
181
|
* enableCompareIndicators?: boolean | {
|
|
148
182
|
* compareTemplate?:string;
|
|
149
183
|
* fallbackTemplate?:string;
|
|
150
184
|
* itemFilterConfig?:InstanceType<import("../EodashItemFilter.vue").default>["$props"]
|
|
151
185
|
* };
|
|
152
|
-
* }> }*/
|
|
153
|
-
type: Object,
|
|
186
|
+
* }> } */ (Object),
|
|
154
187
|
default: () => ({
|
|
155
188
|
enableExportMap: true,
|
|
156
189
|
enableChangeProjection: true,
|
|
@@ -159,6 +192,7 @@ const props = defineProps({
|
|
|
159
192
|
enableSearch: true,
|
|
160
193
|
enableZoom: true,
|
|
161
194
|
enableGlobe: true,
|
|
195
|
+
enableMosaic: true,
|
|
162
196
|
enableFeedback: true,
|
|
163
197
|
searchParams: {},
|
|
164
198
|
}),
|
|
@@ -203,6 +237,7 @@ const btnsProps = computed(() => ({
|
|
|
203
237
|
enableSearch: props.btns.enableSearch ?? true,
|
|
204
238
|
enableZoom: props.btns.enableZoom ?? true,
|
|
205
239
|
enableGlobe: props.btns.enableGlobe ?? true,
|
|
240
|
+
enableMosaic: props.btns.enableMosaic ?? true,
|
|
206
241
|
enableFeedback: props.btns.enableFeedback ?? true,
|
|
207
242
|
searchParams: props.btns.searchParams,
|
|
208
243
|
}));
|
|
@@ -218,22 +253,13 @@ const cursorCoordsRef = useTemplateRef("cursor-coords");
|
|
|
218
253
|
const tooltipProperties = ref([]);
|
|
219
254
|
/** @type {import("vue").Ref<Exclude<import("@/types").EodashStyleJson["tooltip"], undefined>>} */
|
|
220
255
|
const compareTooltipProperties = ref([]);
|
|
221
|
-
|
|
222
|
-
Attribution: { collapsible: boolean };
|
|
223
|
-
ScaleLine?: { target: HTMLElement };
|
|
224
|
-
MousePosition?: { projection: string; coordinateFormat: (c: [number, number]) => string; target: HTMLElement };
|
|
225
|
-
}>} */
|
|
256
|
+
|
|
226
257
|
const controls = computed(() => {
|
|
227
|
-
/** @type {{
|
|
228
|
-
Attribution: { collapsible: boolean };
|
|
229
|
-
ScaleLine?: { target: HTMLElement };
|
|
230
|
-
MousePosition?: { projection: string; coordinateFormat: (c: [number, number]) => string; target: HTMLElement };
|
|
231
|
-
}} */
|
|
232
|
-
const controlsObj = {
|
|
258
|
+
const controlsObj = /** @type {import("@eox/map").ControlDictionary} */ ({
|
|
233
259
|
Attribution: {
|
|
234
260
|
collapsible: true,
|
|
235
261
|
},
|
|
236
|
-
};
|
|
262
|
+
});
|
|
237
263
|
|
|
238
264
|
if (props.enableScaleLine && scaleLineRef.value) {
|
|
239
265
|
controlsObj.ScaleLine = {
|
|
@@ -244,12 +270,10 @@ const controls = computed(() => {
|
|
|
244
270
|
if (props.enableCursorCoordinates && cursorCoordsRef.value) {
|
|
245
271
|
controlsObj.MousePosition = {
|
|
246
272
|
projection: "EPSG:4326",
|
|
247
|
-
coordinateFormat: (
|
|
248
|
-
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
const lngStr = `${Math.abs(lng).toFixed(3)}°${lng >= 0 ? "E" : "W"}`;
|
|
252
|
-
return `${latStr}, ${lngStr}`;
|
|
273
|
+
coordinateFormat: (c) => {
|
|
274
|
+
if (!c) return "";
|
|
275
|
+
const [lon, lat] = c;
|
|
276
|
+
return `${Math.abs(lat).toFixed(3)} °${lat >= 0 ? "N" : "S"}, ${Math.abs(lon).toFixed(3)} °${lon >= 0 ? "E" : "W"}`;
|
|
253
277
|
},
|
|
254
278
|
target: cursorCoordsRef.value,
|
|
255
279
|
};
|
|
@@ -261,28 +285,17 @@ const controls = computed(() => {
|
|
|
261
285
|
const initialCenter = toRaw(props.center);
|
|
262
286
|
const initialZoom = toRaw(mapPosition.value?.[2] ?? props.zoom);
|
|
263
287
|
/** @type {import("vue").Ref<Record<string,any>[]>} */
|
|
264
|
-
const eoxMapLayers = ref(
|
|
265
|
-
{
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
id: "osm",
|
|
270
|
-
title: "Background",
|
|
271
|
-
},
|
|
272
|
-
},
|
|
273
|
-
]);
|
|
288
|
+
const eoxMapLayers = ref(
|
|
289
|
+
/** @type {Record<string,any>[]} */ (
|
|
290
|
+
structuredClone(toRaw(props.baseLayers))
|
|
291
|
+
),
|
|
292
|
+
);
|
|
274
293
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
properties: {
|
|
281
|
-
id: "osm",
|
|
282
|
-
title: "Background",
|
|
283
|
-
},
|
|
284
|
-
},
|
|
285
|
-
]);
|
|
294
|
+
const eoxMapCompareLayers = ref(
|
|
295
|
+
/** @type {Record<string,any>[]} */ (
|
|
296
|
+
structuredClone(toRaw(props.baseLayers))
|
|
297
|
+
),
|
|
298
|
+
);
|
|
286
299
|
|
|
287
300
|
const animationOptions = ref({
|
|
288
301
|
duration: 0, // Initially set to 0 for an instant "jump"
|
|
@@ -290,9 +303,10 @@ const animationOptions = ref({
|
|
|
290
303
|
});
|
|
291
304
|
|
|
292
305
|
/** @type {import("vue").Ref<import("@eox/map").EOxMap | null>} */
|
|
293
|
-
const eoxMap =
|
|
306
|
+
const eoxMap = useTemplateRef("eoxMap");
|
|
294
307
|
/** @type {import("vue").Ref<import("@eox/map").EOxMap | null>} */
|
|
295
|
-
const compareMap =
|
|
308
|
+
const compareMap = useTemplateRef("compareMap");
|
|
309
|
+
|
|
296
310
|
const { selectedCompareStac } = storeToRefs(useSTAcStore());
|
|
297
311
|
const showCompare = computed(() =>
|
|
298
312
|
props.enableCompare && !!selectedCompareStac.value ? "" : "first",
|
|
@@ -301,10 +315,20 @@ const showCompare = computed(() =>
|
|
|
301
315
|
useHandleMapMoveEnd(eoxMap, mapPosition);
|
|
302
316
|
|
|
303
317
|
onMounted(() => {
|
|
304
|
-
const {
|
|
305
|
-
|
|
318
|
+
const {
|
|
319
|
+
selectedCompareStac,
|
|
320
|
+
selectedStac,
|
|
321
|
+
selectedItem,
|
|
322
|
+
selectedCompareItem,
|
|
323
|
+
} = storeToRefs(useSTAcStore());
|
|
324
|
+
if (!eoxMap.value) {
|
|
325
|
+
console.error("EOxMap reference is not available on mounted.");
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
306
328
|
// assign map Element state to eox map
|
|
307
329
|
mapEl.value = eoxMap.value;
|
|
330
|
+
// enable terrain
|
|
331
|
+
mapEl.value.globeConfig.terrain = true;
|
|
308
332
|
|
|
309
333
|
if (props.enableCompare) {
|
|
310
334
|
mapCompareEl.value = compareMap.value;
|
|
@@ -319,6 +343,8 @@ onMounted(() => {
|
|
|
319
343
|
eoxMapCompareLayers,
|
|
320
344
|
eoxMap,
|
|
321
345
|
false,
|
|
346
|
+
selectedCompareItem,
|
|
347
|
+
props.baseLayers,
|
|
322
348
|
);
|
|
323
349
|
|
|
324
350
|
useUpdateTooltipProperties(
|
|
@@ -337,6 +363,7 @@ onMounted(() => {
|
|
|
337
363
|
compareMap,
|
|
338
364
|
props.zoomToExtent,
|
|
339
365
|
selectedItem,
|
|
366
|
+
props.baseLayers,
|
|
340
367
|
);
|
|
341
368
|
// After the initial mount and "jump", set the animation duration for subsequent flyTo calls
|
|
342
369
|
nextTick(() => {
|
|
@@ -344,14 +371,23 @@ onMounted(() => {
|
|
|
344
371
|
});
|
|
345
372
|
});
|
|
346
373
|
|
|
374
|
+
// sync map loading with the global loading state
|
|
375
|
+
useMapLoading(eoxMap, compareMap);
|
|
376
|
+
|
|
347
377
|
useUpdateTooltipProperties(eodashCollections, tooltipProperties);
|
|
348
378
|
|
|
349
379
|
const mainTooltipStyles = computed(() => ({
|
|
350
|
-
visibility:
|
|
380
|
+
visibility:
|
|
381
|
+
tooltipProperties.value.length || !!tooltipAdapter.value
|
|
382
|
+
? "visible"
|
|
383
|
+
: "hidden",
|
|
351
384
|
}));
|
|
352
385
|
|
|
353
386
|
const compareTooltipStyles = computed(() => ({
|
|
354
|
-
visibility:
|
|
387
|
+
visibility:
|
|
388
|
+
compareTooltipProperties.value.length || !!tooltipAdapter.value
|
|
389
|
+
? "visible"
|
|
390
|
+
: "hidden",
|
|
355
391
|
}));
|
|
356
392
|
/**
|
|
357
393
|
* @param {"main" | "compare"} map
|
|
@@ -377,6 +413,9 @@ const tooltipPropertyTransform = (map) => {
|
|
|
377
413
|
(prop) => prop.id === param.key,
|
|
378
414
|
);
|
|
379
415
|
if (!tooltipProp) {
|
|
416
|
+
if (tooltipAdapter.value) {
|
|
417
|
+
return tooltipAdapter.value(param, map);
|
|
418
|
+
}
|
|
380
419
|
return undefined;
|
|
381
420
|
}
|
|
382
421
|
if (typeof param.value === "object") {
|
|
@@ -388,7 +427,6 @@ const tooltipPropertyTransform = (map) => {
|
|
|
388
427
|
: 4;
|
|
389
428
|
param.value = Number(param.value).toFixed(decimals).toString();
|
|
390
429
|
}
|
|
391
|
-
|
|
392
430
|
return {
|
|
393
431
|
key: tooltipProp.title || tooltipProp.id,
|
|
394
432
|
value: param.value + " " + (tooltipProp.appendix || ""),
|
|
@@ -405,58 +443,6 @@ onMounted(() => {
|
|
|
405
443
|
</script>
|
|
406
444
|
|
|
407
445
|
<style scoped>
|
|
408
|
-
#cursor-coordinates {
|
|
409
|
-
position: fixed;
|
|
410
|
-
left: 24px;
|
|
411
|
-
bottom: 54px; /* Tighter spacing: watermark at 6px + ~48px */
|
|
412
|
-
color: rgba(0, 0, 0, 0.9);
|
|
413
|
-
font-size: 10px;
|
|
414
|
-
font-family: var(--eox-body-font-family);
|
|
415
|
-
background: #fffe;
|
|
416
|
-
border-radius: 4px;
|
|
417
|
-
border: none;
|
|
418
|
-
padding: 0px 3px;
|
|
419
|
-
max-height: 24px;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
@media (max-width: 959px) {
|
|
423
|
-
#cursor-coordinates {
|
|
424
|
-
display: none; /* Hidden in mobile mode */
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
#scale-line {
|
|
429
|
-
position: fixed;
|
|
430
|
-
left: 24px;
|
|
431
|
-
bottom: 28px; /* Tighter spacing: watermark at 6px + ~22px */
|
|
432
|
-
color: #fff;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
@media (max-width: 959px) {
|
|
436
|
-
#scale-line {
|
|
437
|
-
bottom: 102px; /* Adjusted for mobile bottom nav - closer to coordinates */
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
:deep(.ol-scale-line) {
|
|
442
|
-
background: #fffe !important;
|
|
443
|
-
border-radius: 4px !important;
|
|
444
|
-
border: none !important;
|
|
445
|
-
padding: 0px 3px 3px 3px !important;
|
|
446
|
-
font-size: 10px !important;
|
|
447
|
-
font-family: var(--eox-body-font-family);
|
|
448
|
-
max-height: 20px;
|
|
449
|
-
}
|
|
450
|
-
:deep(.ol-scale-line-inner) {
|
|
451
|
-
display: flex;
|
|
452
|
-
justify-content: center;
|
|
453
|
-
border: 1px solid rgba(0, 0, 0, 0.5) !important;
|
|
454
|
-
border-top: none !important;
|
|
455
|
-
color: #333 !important;
|
|
456
|
-
font-weight: 500 !important;
|
|
457
|
-
transform: translateY(1px);
|
|
458
|
-
}
|
|
459
|
-
|
|
460
446
|
.map-buttons-container {
|
|
461
447
|
position: fixed;
|
|
462
448
|
left: 0;
|
|
@@ -11,7 +11,20 @@ export const switchGlobe = () => {
|
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
if (!isGlobe.value) {
|
|
14
|
-
|
|
14
|
+
// tmp: we remove the vector layers from the globe until
|
|
15
|
+
// we have better support for them
|
|
16
|
+
const layers = addCorsAnonym([...getLayers()])
|
|
17
|
+
.filter((layer) => layer.type !== "Vector")
|
|
18
|
+
.map((layer) => {
|
|
19
|
+
if (layer.type === "Group") {
|
|
20
|
+
return {
|
|
21
|
+
...layer,
|
|
22
|
+
layers: layer.layers.filter((l) => l.type !== "Vector"),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return layer;
|
|
26
|
+
});
|
|
27
|
+
mapEl.value.layers = layers;
|
|
15
28
|
}
|
|
16
29
|
mapEl.value.projection = isGlobe.value ? "EPSG:3857" : "globe";
|
|
17
30
|
if (isGlobe.value) {
|
|
@@ -20,61 +33,81 @@ export const switchGlobe = () => {
|
|
|
20
33
|
isGlobe.value = !isGlobe.value;
|
|
21
34
|
};
|
|
22
35
|
|
|
36
|
+
function getRoot() {
|
|
37
|
+
const eodashComponent = document.querySelector("eo-dash");
|
|
38
|
+
return eodashComponent ? eodashComponent.shadowRoot : document;
|
|
39
|
+
}
|
|
40
|
+
|
|
23
41
|
function hideAllPanels() {
|
|
24
|
-
const
|
|
42
|
+
const root = getRoot();
|
|
43
|
+
const allPanels = root?.querySelectorAll(
|
|
25
44
|
"eox-layout-item:not([class='bg-panel'])",
|
|
26
45
|
);
|
|
27
|
-
|
|
46
|
+
|
|
47
|
+
allPanels?.forEach((panel) => {
|
|
28
48
|
if (!panel || !(panel instanceof HTMLElement)) {
|
|
29
49
|
return;
|
|
30
50
|
}
|
|
31
51
|
panel.style.display = "none";
|
|
32
52
|
});
|
|
53
|
+
|
|
54
|
+
const mapButtons = root?.querySelector(".map-buttons");
|
|
55
|
+
if (mapButtons instanceof HTMLElement) {
|
|
56
|
+
mapButtons.style.padding = "1rem";
|
|
57
|
+
}
|
|
33
58
|
}
|
|
59
|
+
|
|
34
60
|
function showAllPanels() {
|
|
35
|
-
const
|
|
61
|
+
const root = getRoot();
|
|
62
|
+
const allPanels = root?.querySelectorAll(
|
|
36
63
|
"eox-layout-item:not([class='bg-panel'])",
|
|
37
64
|
);
|
|
38
|
-
allPanels
|
|
65
|
+
allPanels?.forEach((panel) => {
|
|
39
66
|
if (!panel || !(panel instanceof HTMLElement)) {
|
|
40
67
|
return;
|
|
41
68
|
}
|
|
42
69
|
panel.style.display = "";
|
|
43
70
|
});
|
|
71
|
+
|
|
72
|
+
const mapButtons = root?.querySelector(".map-buttons");
|
|
73
|
+
if (mapButtons instanceof HTMLElement) {
|
|
74
|
+
mapButtons.style.padding = "";
|
|
75
|
+
}
|
|
44
76
|
}
|
|
45
77
|
/**
|
|
46
78
|
*
|
|
47
|
-
* @param {import("@eox/map").EoxLayer[]} layers
|
|
48
|
-
* @
|
|
79
|
+
* @param {import("@eox/map").EoxLayer[]} layers - eox map layers
|
|
80
|
+
* @returns {import("@eox/map").EoxLayer[]} anonymized Cors
|
|
49
81
|
*/
|
|
50
82
|
function addCorsAnonym(layers) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
83
|
+
return /** @type {import("@eox/map").EoxLayer[]} */ (
|
|
84
|
+
layers.map((layer) => {
|
|
85
|
+
if (layer.type === "Group") {
|
|
86
|
+
layer.layers = addCorsAnonym([...(layer.layers ?? [])]);
|
|
87
|
+
return layer;
|
|
88
|
+
}
|
|
89
|
+
// check if not mapbox style as a fix for ts error
|
|
90
|
+
if (layer.type === "MapboxStyle") {
|
|
91
|
+
return layer;
|
|
92
|
+
}
|
|
61
93
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
crossOrigin: "anonymous",
|
|
68
|
-
},
|
|
69
|
-
...(layer.sources && {
|
|
70
|
-
sources: layer.sources.map((source) => ({
|
|
71
|
-
...source,
|
|
94
|
+
return {
|
|
95
|
+
...layer,
|
|
96
|
+
...("source" in layer && {
|
|
97
|
+
source: {
|
|
98
|
+
...layer.source,
|
|
72
99
|
crossOrigin: "anonymous",
|
|
73
|
-
}
|
|
100
|
+
},
|
|
101
|
+
...(layer.sources && {
|
|
102
|
+
sources: layer.sources.map((source) => ({
|
|
103
|
+
...source,
|
|
104
|
+
crossOrigin: "anonymous",
|
|
105
|
+
})),
|
|
106
|
+
}),
|
|
74
107
|
}),
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
108
|
+
};
|
|
109
|
+
})
|
|
110
|
+
);
|
|
78
111
|
}
|
|
79
112
|
|
|
80
113
|
export const onMapZoomOut = () => {
|
|
@@ -10,6 +10,7 @@ import log from "loglevel";
|
|
|
10
10
|
* } selectedIndicator
|
|
11
11
|
* @param {EodashCollection[]} eodashCols
|
|
12
12
|
* @param {string | import("stac-ts").StacItem | null} [timeOrItem] - time as a string, or a stac item
|
|
13
|
+
* @param {Record<string, any>[]} [defaultBaseLayers] - Optional default baselayers to use if the indicator does not provide any
|
|
13
14
|
* @returns {Promise<Record<string, any>[]>}
|
|
14
15
|
*/
|
|
15
16
|
|
|
@@ -17,6 +18,7 @@ export const createLayersConfig = async (
|
|
|
17
18
|
selectedIndicator,
|
|
18
19
|
eodashCols,
|
|
19
20
|
timeOrItem,
|
|
21
|
+
defaultBaseLayers = [],
|
|
20
22
|
) => {
|
|
21
23
|
log.debug(
|
|
22
24
|
"Creating layers config",
|
|
@@ -38,17 +40,25 @@ export const createLayersConfig = async (
|
|
|
38
40
|
for (const ec of eodashCols) {
|
|
39
41
|
/** @type {Record<string,any>[]} */
|
|
40
42
|
let layers;
|
|
43
|
+
let dateOrItem;
|
|
41
44
|
if (timeOrItem) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
if (typeof timeOrItem === "string" && timeOrItem.includes("/")) {
|
|
46
|
+
dateOrItem = timeOrItem;
|
|
47
|
+
} else {
|
|
48
|
+
dateOrItem =
|
|
49
|
+
typeof timeOrItem === "string" ? new Date(timeOrItem) : timeOrItem;
|
|
50
|
+
}
|
|
51
|
+
layers = await ec.createLayersJson(/** @type {any} */ (dateOrItem));
|
|
45
52
|
} else {
|
|
46
53
|
layers = await ec.createLayersJson(undefined);
|
|
47
54
|
}
|
|
55
|
+
|
|
48
56
|
// Add expand to all analysis layers
|
|
49
57
|
layers.forEach((dl) => {
|
|
50
|
-
dl.properties
|
|
51
|
-
|
|
58
|
+
if (!dl.properties?.layerControlExclusive) {
|
|
59
|
+
dl.properties.layerControlExpand = true;
|
|
60
|
+
dl.properties.layerControlToolsExpand = true;
|
|
61
|
+
}
|
|
52
62
|
});
|
|
53
63
|
dataLayers.layers.push(...layers);
|
|
54
64
|
}
|
|
@@ -141,17 +151,7 @@ export const createLayersConfig = async (
|
|
|
141
151
|
});
|
|
142
152
|
} else {
|
|
143
153
|
// Default to some baselayer
|
|
144
|
-
baseLayers.layers.push(
|
|
145
|
-
type: "Tile",
|
|
146
|
-
properties: {
|
|
147
|
-
id: "osm",
|
|
148
|
-
title: "Background",
|
|
149
|
-
layerControlExclusive: true,
|
|
150
|
-
},
|
|
151
|
-
source: {
|
|
152
|
-
type: "OSM",
|
|
153
|
-
},
|
|
154
|
-
});
|
|
154
|
+
baseLayers.layers.push(...defaultBaseLayers);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
if (baseLayers.layers.length) {
|