@eodash/eodash 5.0.0-alpha.2.15 → 5.0.0-alpha.2.16

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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/core/client/composables/EodashMap.js +245 -0
  3. package/core/client/composables/index.js +2 -2
  4. package/core/client/eodash.js +1 -2
  5. package/core/client/store/Actions.js +30 -10
  6. package/core/client/store/States.js +4 -1
  7. package/core/client/store/stac.js +52 -2
  8. package/core/client/types.d.ts +6 -2
  9. package/core/client/utils/createLayers.js +146 -39
  10. package/core/client/utils/eodashSTAC.js +94 -19
  11. package/core/client/utils/helpers.js +189 -11
  12. package/core/client/utils/states.js +17 -0
  13. package/dist/client/{DashboardLayout-DQE4aB6e.js → DashboardLayout-CCtyOil0.js} +2 -2
  14. package/dist/client/{DynamicWebComponent-TrDsJuF8.js → DynamicWebComponent-But2r1Sj.js} +2 -2
  15. package/dist/client/EodashDatePicker-jeYiWflv.js +247 -0
  16. package/dist/client/{EodashItemFilter-Bp0lcvbI.js → EodashItemFilter-BFlfWeE_.js} +2028 -2024
  17. package/dist/client/EodashLayerControl-BhZL4pYM.js +24358 -0
  18. package/dist/client/{EodashMap--2y6XErO.js → EodashMap-C5tOgVOv.js} +22268 -24006
  19. package/dist/client/{EodashMapBtns-BSf3iUAb.js → EodashMapBtns-CdDfVQj0.js} +2 -2
  20. package/dist/client/{ExportState-BTONkMIz.js → ExportState-CKCCN_VI.js} +142 -136
  21. package/dist/client/{Footer-B7JDXdxT.js → Footer-B9yVgyzx.js} +67 -65
  22. package/dist/client/{Header-Dlumetq0.js → Header-CPIlUEOq.js} +4 -4
  23. package/dist/client/{IframeWrapper-DRjSqhFx.js → IframeWrapper-DRw1kHJm.js} +1 -1
  24. package/dist/client/{MobileLayout-9z2X_rmU.js → MobileLayout-CPxVee5U.js} +6 -6
  25. package/dist/client/{PopUp-CXbMBYGh.js → PopUp-Dca-gx9a.js} +5 -5
  26. package/dist/client/{VImg-Dgk5tryv.js → VImg-PHLA1nP1.js} +2 -2
  27. package/dist/client/{VMain-Ubv9jyyL.js → VMain-Ck81LJfb.js} +2 -2
  28. package/dist/client/{VOverlay-CqZC2CbA.js → VOverlay-CL4hiJB8.js} +92 -92
  29. package/dist/client/{WidgetsContainer-CHK_3dlD.js → WidgetsContainer-jxk3kw-d.js} +1 -1
  30. package/dist/client/asWebComponent-3OsFQJVx.js +23633 -0
  31. package/dist/client/eo-dash.js +1 -1
  32. package/dist/client/{forwardRefs-OX_5lLJW.js → forwardRefs-BxZaq9ml.js} +1 -1
  33. package/dist/client/{index-B_KfD-iF.js → index-Vul961Xy.js} +23 -23
  34. package/dist/client/{lerc-B4lXefGh-CplqAh1B.js → lerc-B4lXefGh-BESXOHWk.js} +1 -1
  35. package/dist/client/{ssrBoot-BZTPJZkq.js → ssrBoot-BFMBrCqY.js} +1 -1
  36. package/dist/client/style.css +2 -2
  37. package/dist/client/{transition-Dq8XIV_D.js → transition-U5aFjJtV.js} +1 -1
  38. package/dist/client/{webfontloader-qotgY98I.js → webfontloader-D_JbBwHu.js} +1 -1
  39. package/package.json +5 -3
  40. package/widgets/EodashDatePicker.vue +32 -40
  41. package/widgets/EodashItemFilter.vue +2 -0
  42. package/widgets/EodashLayerControl.vue +69 -2
  43. package/widgets/EodashMap.vue +35 -208
  44. package/widgets/ExportState.vue +8 -7
  45. package/dist/client/EodashDatePicker-CkA9rHp6.js +0 -252
  46. package/dist/client/EodashLayerControl-lfLYqyeU.js +0 -20963
  47. package/dist/client/_commonjsHelpers-DaMA6jEr.js +0 -8
  48. package/dist/client/asWebComponent-Ddg71BJk.js +0 -20451
  49. package/dist/client/helpers-BCawTwFg.js +0 -1390
@@ -1,4 +1,4 @@
1
- import { p as m, ay as b, d, bi as l, ab as u } from "./asWebComponent-Ddg71BJk.js";
1
+ import { p as m, az as b, d, bo as l, ab as u } from "./asWebComponent-3OsFQJVx.js";
2
2
  const j = m({
3
3
  transition: {
4
4
  type: [Boolean, String, Object],
@@ -1,4 +1,4 @@
1
- import { g as Ft } from "./_commonjsHelpers-DaMA6jEr.js";
1
+ import { av as Ft } from "./asWebComponent-3OsFQJVx.js";
2
2
  var ot = { exports: {} };
3
3
  (function(O) {
4
4
  (function() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eodash/eodash",
3
- "version": "5.0.0-alpha.2.15",
3
+ "version": "5.0.0-alpha.2.16",
4
4
  "type": "module",
5
5
  "types": "./core/client/types.d.ts",
6
6
  "files": [
@@ -25,6 +25,7 @@
25
25
  },
26
26
  "browser": "./core/client/main.js",
27
27
  "scripts": {
28
+ "start": "npx eodash dev --entryPoint core/client/eodash.js",
28
29
  "prepare": "rollup -c",
29
30
  "prepack": "npm run build:lib",
30
31
  "dev": "npx eodash dev --entryPoint core/client/eodash.js",
@@ -48,10 +49,11 @@
48
49
  "dependencies": {
49
50
  "@eox/itemfilter": "^1.0.1",
50
51
  "@eox/jsonform": "^0.8.2",
51
- "@eox/layercontrol": "^0.18.1",
52
+ "@eox/layercontrol": "^0.18.2-dev.1722439716.0",
52
53
  "@eox/layout": "^0.1.0",
53
- "@eox/map": "1.11.2",
54
+ "@eox/map": "1.12.1-dev.1723130201.0",
54
55
  "@eox/stacinfo": "^0.3.3",
56
+ "@eox/timecontrol": "^0.6.1",
55
57
  "@mdi/js": "^7.4.47",
56
58
  "@vitejs/plugin-vue": "^5.0.5",
57
59
  "animated-details": "gist:2912bb049fa906671807415eb0e87188",
@@ -37,24 +37,21 @@
37
37
  <script setup>
38
38
  import { DatePicker as VCDatePicker } from "v-calendar";
39
39
  import "v-calendar/style.css";
40
- import { computed, ref, onMounted, watch, inject } from "vue";
41
- import { eodashKey } from "@/utils/keys";
42
- import { toAbsolute } from "stac-js/src/http.js";
40
+ import { computed, ref, onMounted, watch, reactive } from "vue";
43
41
  import { storeToRefs } from "pinia";
44
42
  import { useSTAcStore } from "@/store/stac";
45
43
  import { datetime } from "@/store/States";
46
44
  import { mdiRayStartArrow, mdiRayEndArrow } from "@mdi/js";
47
- import { extractCollectionUrls } from "@/utils/helpers";
48
- import axios from "axios";
45
+ import { eodashCollections } from "@/utils/states";
49
46
 
50
47
  /**
51
48
  * @param {boolean} reverse
52
49
  */
53
50
  function jumpDate(reverse) {
54
- if (attributes.value && attributes.value.length > 0) {
51
+ if (attributes.length) {
55
52
  // We have potentially multiple collections we need to iterate (currently only one)
56
53
  let latestDateMS = reverse ? Infinity : -Infinity;
57
- attributes.value.forEach((coll) => {
54
+ attributes.forEach((coll) => {
58
55
  if (coll?.dates) {
59
56
  coll.dates.forEach((d) => {
60
57
  // TODO: we need to handle time ranges and other options here
@@ -75,8 +72,6 @@ function jumpDate(reverse) {
75
72
  }
76
73
  }
77
74
 
78
- const eodashConfig = /** @type {import("@/types").Eodash} */ inject(eodashKey);
79
-
80
75
  const masks = ref({
81
76
  input: "YYYY-MM-DD",
82
77
  });
@@ -84,14 +79,14 @@ const masks = ref({
84
79
  /**
85
80
  * Attributes displayed on datepicker
86
81
  *
87
- * @type {import("vue").Ref<
82
+ * @type {import("vue").Reactive<
88
83
  * (
89
84
  * | import("v-calendar/dist/types/src/utils/attribute").AttributeConfig
90
85
  * | undefined
91
86
  * )[]
92
87
  * >}
93
88
  */
94
- const attributes = ref([]);
89
+ const attributes = reactive([]);
95
90
 
96
91
  const currentDate = computed({
97
92
  get() {
@@ -108,21 +103,13 @@ const currentDate = computed({
108
103
  }
109
104
  },
110
105
  });
111
- /** @type {import("@/types").WebComponentProps["onMounted"]} */
106
+
112
107
  onMounted(() => {
113
108
  const { selectedStac } = storeToRefs(useSTAcStore());
114
109
  watch(
115
110
  [selectedStac],
116
111
  async ([updatedStac]) => {
117
112
  if (updatedStac) {
118
- const parentCollUrl = toAbsolute(
119
- `./${updatedStac.id}/collection.json`,
120
- eodashConfig.stacEndpoint,
121
- );
122
- const collectionUrls = extractCollectionUrls(
123
- selectedStac.value,
124
- parentCollUrl,
125
- );
126
113
  const wongPalette = [
127
114
  "#009E73",
128
115
  "#0072B2",
@@ -131,28 +118,33 @@ onMounted(() => {
131
118
  "#56B4E9",
132
119
  "#D55E00",
133
120
  ];
134
- for (let idx = 0; idx < collectionUrls.length; idx++) {
135
- const stacCollection = await axios
136
- .get(collectionUrls[idx])
137
- .then((resp) => resp.data);
138
- const dates = stacCollection.links
139
- .filter(
140
- (/** @type {{ rel: string; datetime: string }} */ item) =>
141
- item.rel === "item" && "datetime" in item,
142
- )
143
- .map(
144
- (/** @type {{ datetime: string }} */ it) => new Date(it.datetime),
145
- );
146
- attributes.value = [
147
- {
148
- bar: {
149
- style: {
150
- backgroundColor: wongPalette[idx % wongPalette.length],
151
- },
121
+
122
+ // remove old values
123
+ attributes.length = 0;
124
+ for (let idx = 0; idx < eodashCollections.length; idx++) {
125
+ const dates = [
126
+ ...new Set(
127
+ eodashCollections[idx]
128
+ .getItems()
129
+ ?.map((it) => new Date(/** @type {string} */ (it.datetime))),
130
+ ),
131
+ ];
132
+ attributes.push({
133
+ key: "id-" + idx.toString() + Math.random().toString(16).slice(2),
134
+ bar: {
135
+ style: {
136
+ backgroundColor: wongPalette[idx % wongPalette.length],
152
137
  },
153
- dates,
154
138
  },
155
- ];
139
+ dates,
140
+ });
141
+ }
142
+ // We try to set the current time selection
143
+ // to latest extent date
144
+ // @ts-expect-error it seems the temporal extent is not defined in type
145
+ const interval = updatedStac?.extent?.temporal?.interval;
146
+ if (interval && interval.length > 0 && interval[0].length > 1) {
147
+ currentDate.value = new Date(interval[0][1]);
156
148
  }
157
149
  }
158
150
  },
@@ -71,6 +71,8 @@ const onSelect = async (evt) => {
71
71
  .forEach((res) => res.setAttribute("style", defaultStyle));
72
72
  const item = /** @type {import('stac-ts').StacLink} */ evt.detail;
73
73
  if (item) {
74
+ // Reset compare stac to empty
75
+ store.resetSelectedCompareSTAC();
74
76
  await store.loadSelectedSTAC(item.href);
75
77
  } else {
76
78
  // TODO: it is possible to unselect items now
@@ -1,13 +1,80 @@
1
1
  <template>
2
2
  <span class="d-flex flex-column fill-height overflow-auto pa-4">
3
- <eox-layercontrol v-if="mapEl" :for="mapEl" ref="eoxLayercontrol" />
3
+ <eox-layercontrol
4
+ v-if="mapElement"
5
+ :for="mapElement"
6
+ @datetime:updated="debouncedHandleDateTime"
7
+ class="fill-height"
8
+ ref="eoxLayercontrol"
9
+ />
4
10
  </span>
5
11
  </template>
6
12
  <script setup>
7
13
  import "@eox/layercontrol";
8
14
  import "@eox/jsonform";
15
+ import "@eox/timecontrol";
16
+
9
17
  import { ref } from "vue";
10
- import { mapEl } from "@/store/States";
18
+ import { mapEl, mapCompareEl } from "@/store/States";
19
+ import { getColFromLayer } from "@/utils/helpers";
20
+ import { eodashCollections, eodashCompareCollections } from "@/utils/states";
21
+
22
+ const props = defineProps({
23
+ map: {
24
+ type: String,
25
+ default: "first",
26
+ },
27
+ });
28
+
29
+ const eodashCols =
30
+ props.map === "second" ? eodashCompareCollections : eodashCollections;
31
+ const mapElement = props.map === "second" ? mapCompareEl : mapEl;
32
+
11
33
  /** @type { import("vue").Ref<HTMLElement & Record<string,any> | null>} */
12
34
  const eoxLayercontrol = ref(null);
35
+
36
+ /** @param {CustomEvent<{layer:import('ol/layer').Layer; datetime:string;}>} evt */
37
+ const handleDatetimeUpdate = async (evt) => {
38
+ const { layer, datetime } = evt.detail;
39
+
40
+ const ec = await getColFromLayer(eodashCols, layer);
41
+
42
+ /** @type {Record<string,any>[] | undefined} */
43
+ let updatedLayers = [];
44
+
45
+ if (ec) {
46
+ await ec.fetchCollection();
47
+ updatedLayers = await ec.updateLayerJson(datetime, layer.get("id"));
48
+ }
49
+ /** @type {Record<String,any>[] | undefined} */
50
+ const dataLayers = updatedLayers?.find(
51
+ (l) => l?.properties?.id === "AnalysisGroup",
52
+ )?.layers;
53
+
54
+ if (dataLayers?.length) {
55
+ // Add expand to all analysis layers
56
+ dataLayers?.forEach((dl) => {
57
+ dl.properties.layerControlExpand = true;
58
+ dl.properties.layerControlToolsExpand = true;
59
+ });
60
+ // assign layers to the map
61
+ /** @type {HTMLElement & Record<string,any>} */
62
+ (mapElement.value).layers = updatedLayers;
63
+ }
64
+ };
65
+
66
+ // ----- debounce logic
67
+ /** @type {NodeJS.Timeout | undefined} */
68
+ let timeout;
69
+
70
+ /**
71
+ * @param {CustomEvent<{layer:import('ol/layer').Layer; datetime:string;}>} evt
72
+ **/
73
+ const debouncedHandleDateTime = (evt) => {
74
+ clearTimeout(timeout);
75
+ timeout = setTimeout(() => {
76
+ handleDatetimeUpdate(evt);
77
+ }, 500);
78
+ };
79
+ // ------
13
80
  </script>
@@ -6,8 +6,8 @@
6
6
  <eox-map
7
7
  class="fill-height fill-width overflow-none"
8
8
  slot="first"
9
- sync="eox-map#compare"
10
9
  ref="eoxMap"
10
+ :sync="compareMap"
11
11
  id="main"
12
12
  :config="eoxMapConfig"
13
13
  />
@@ -21,21 +21,21 @@
21
21
  </eox-map-compare>
22
22
  </template>
23
23
  <script setup>
24
- import { onMounted, onUnmounted, reactive, ref, watch } from "vue";
25
- import { EodashCollection } from "@/utils/eodashSTAC";
26
- import { extractCollectionUrls } from "@/utils/helpers";
24
+ import { computed, onMounted, reactive, ref } from "vue";
27
25
  import {
28
26
  currentUrl,
29
27
  currentCompareUrl,
30
28
  datetime,
31
29
  mapEl,
32
30
  mapPosition,
31
+ mapCompareEl,
33
32
  } from "@/store/States";
34
- import { transformExtent } from "ol/proj";
35
33
  import { storeToRefs } from "pinia";
36
34
  import { useSTAcStore } from "@/store/stac";
37
35
  import "@eox/map";
38
36
  import "@eox/map/dist/eox-map-advanced-layers-and-sources.js";
37
+ import { eodashCollections, eodashCompareCollections } from "@/utils/states";
38
+ import { useHandleMapMoveEnd, useInitMap } from "@/composables/EodashMap";
39
39
 
40
40
  const props = defineProps({
41
41
  enableCompare: {
@@ -44,13 +44,11 @@ const props = defineProps({
44
44
  },
45
45
  });
46
46
 
47
- /** @type {import("vue").Ref<(HTMLElement & Record<string,any>) | null>} */
47
+ /** @type {import("vue").Ref<(HTMLElement & Record<string,any> & { map:import("ol").Map }) | null>} */
48
48
  const eoxMap = ref(null);
49
- /** @type {import("vue").Ref<(HTMLElement & Record<string,any>) | null>} */
49
+ /** @type {import("vue").Ref<(HTMLElement & Record<string,any> & { map:import("ol").Map }) | null>} */
50
50
  const compareMap = ref(null);
51
51
 
52
- const showCompare = ref("first");
53
-
54
52
  const eoxMapConfig = reactive({
55
53
  /** @type {(number|undefined)[] | undefined} */
56
54
  center: [15, 48],
@@ -86,209 +84,38 @@ if (mapPosition && mapPosition.value && mapPosition.value.length === 3) {
86
84
  eoxMapConfig.center = [mapPosition.value?.[0], mapPosition.value[1]];
87
85
  eoxMapConfig.zoom = mapPosition.value[2];
88
86
  }
89
-
90
- /** @type {import("openlayers").EventsListenerFunctionType} */
91
- const handleMoveEnd = (evt) => {
92
- const map = /** @type {import("openlayers").Map | undefined} */ (
93
- /** @type {any} */ (evt).map
94
- );
95
- const [x, y] = map?.getView().getCenter() ?? [0, 0];
96
- const z = map?.getView().getZoom();
97
- if (!Number.isNaN(x) && !Number.isNaN(y) && !Number.isNaN(z)) {
98
- mapPosition.value = [x, y, z];
99
- }
100
- };
101
-
102
- const store = useSTAcStore();
103
- /**
104
- *
105
- * @param {import("vue").Ref<string>} baseUrl
106
- * @param {string} updatedTime
107
- * @param {import("vue").Ref<
108
- * | import("stac-ts").StacCatalog
109
- * | import("stac-ts").StacCollection
110
- * | import("stac-ts").StacItem
111
- * | null
112
- * >} selectedStac
113
- */
114
- const createLayersConfig = async (baseUrl, updatedTime, selectedStac) => {
115
- const collectionUrls = extractCollectionUrls(
116
- selectedStac.value,
117
- baseUrl.value,
118
- );
119
- const eodashCollections = collectionUrls.map(
120
- (cu) => new EodashCollection(cu),
121
- );
122
-
123
- const layersCollection = [];
124
- const dataLayers = {
125
- type: "Group",
126
- properties: {
127
- id: "AnalysisGroup",
128
- title: "Analysis Layers",
129
- layerControlExpand: true,
130
- },
131
- layers: /** @type {Record<string,any>[]}*/ ([]),
132
- };
133
-
134
- for (const ec of eodashCollections) {
135
- let layers;
136
- if (updatedTime) {
137
- layers = await ec.createLayersJson(new Date(updatedTime));
138
- } else {
139
- layers = await ec.createLayersJson();
140
- }
141
- if (layers) {
142
- dataLayers.layers.push(...layers);
143
- }
144
- }
145
- // Add expand to all analysis layers
146
- dataLayers.layers.forEach((dl) => {
147
- dl.properties.layerControlExpand = true;
148
- dl.properties.layerControlToolsExpand = true;
149
- });
150
-
151
- layersCollection.push(dataLayers);
152
- const indicator = new EodashCollection(currentUrl.value);
153
- const indicatorLayers = await indicator.buildJsonArray(
154
- //@ts-expect-error we use this function to generate collection level visualization
155
- selectedStac.value,
156
- currentUrl.value,
157
- selectedStac.value?.title ?? "",
158
- selectedStac.value?.endpointtype ?? false,
159
- );
160
-
161
- const baseLayers = {
162
- type: "Group",
163
- properties: {
164
- id: "BaseLayersGroup",
165
- title: "Base Layers",
166
- },
167
- layers: /** @type {Record<string,any>[]}*/ ([]),
168
- };
169
-
170
- const indicatorBaseLayers = indicatorLayers.filter(
171
- (l) => l.properties.group === "baselayer",
172
- );
173
- if (indicatorBaseLayers.length) {
174
- baseLayers.layers.push(...indicatorBaseLayers);
175
-
176
- // Add exclusive to baselayers and make sure only one is selected
177
- baseLayers.layers.forEach((bl) => {
178
- bl.properties.layerControlExclusive = true;
179
- });
180
- } else {
181
- // Default to some baselayer
182
- baseLayers.layers.push({
183
- type: "Tile",
184
- properties: {
185
- id: "osm",
186
- title: "Background",
187
- layerControlExclusive: true,
188
- },
189
- source: {
190
- type: "OSM",
191
- },
192
- });
193
- }
194
-
195
- if (baseLayers.layers.length) {
196
- layersCollection.push(baseLayers);
197
- }
198
-
199
- const overlayLayers = {
200
- type: "Group",
201
- properties: {
202
- id: "OverlayGroup",
203
- title: "Overlay Layers",
204
- },
205
- layers: /** @type {Record<string,any>[]}*/ ([]),
206
- };
207
-
208
- const indicatorOverlays = indicatorLayers.filter(
209
- (l) => l.properties.group === "overlay",
87
+ const showCompare = computed(() =>
88
+ props.enableCompare && !!selectedCompareStac.value ? "" : "first",
89
+ );
90
+
91
+ useHandleMapMoveEnd(eoxMap, mapPosition);
92
+
93
+ const { selectedCompareStac, selectedStac } = storeToRefs(useSTAcStore());
94
+
95
+ if (props.enableCompare) {
96
+ useInitMap(
97
+ compareMap,
98
+ //@ts-expect-error todo selectedStac as collection
99
+ selectedCompareStac,
100
+ eodashCompareCollections,
101
+ currentCompareUrl,
102
+ datetime,
210
103
  );
211
- if (indicatorOverlays.length) {
212
- overlayLayers.layers.push(...indicatorOverlays);
213
- layersCollection.unshift(overlayLayers);
214
- }
215
-
216
- return layersCollection;
217
- };
104
+ }
105
+ useInitMap(
106
+ eoxMap,
107
+ //@ts-expect-error todo selectedStac as collection
108
+ selectedStac,
109
+ eodashCollections,
110
+ currentUrl,
111
+ datetime,
112
+ );
218
113
 
219
114
  onMounted(() => {
220
- mapEl.value = /** @type {HTMLElement & Record<string,any>} */ (eoxMap.value);
221
-
222
- /** @type {import('ol/Map').default} */
223
- (eoxMap.value?.map)?.on("moveend", handleMoveEnd);
224
-
225
- const { selectedStac, selectedCompareStac } = storeToRefs(store);
115
+ // assign map Element state to eox map
116
+ mapEl.value = eoxMap.value;
226
117
  if (props.enableCompare) {
227
- watch(
228
- [selectedCompareStac, datetime],
229
- async (
230
- [updatedCompareStac, updatedTime],
231
- [_previousCompareStac, _previousTime],
232
- ) => {
233
- if (updatedCompareStac) {
234
- const compareLayersCollection = await createLayersConfig(
235
- currentCompareUrl,
236
- updatedTime,
237
- selectedCompareStac,
238
- );
239
- /** @type {any} */
240
- (compareMap.value).layers = compareLayersCollection;
241
- showCompare.value = "";
242
- }
243
- },
244
- );
118
+ mapCompareEl.value = compareMap.value;
245
119
  }
246
-
247
- watch(
248
- [selectedStac, datetime],
249
- async ([updatedStac, updatedTime], [previousSTAC, _previousTime]) => {
250
- if (updatedStac) {
251
- const layersCollection = await createLayersConfig(
252
- currentUrl,
253
- updatedTime,
254
- selectedStac,
255
- );
256
- /** @type {any} */
257
- (eoxMap.value).layers = layersCollection;
258
-
259
- // only on different indicator selection and not on time change
260
- if (previousSTAC?.id !== updatedStac.id) {
261
- showCompare.value = "first";
262
- // Try to move map view to extent
263
- // Make sure for now we are always converting from 4326
264
- // of stac items into current map projection
265
- // TODO: This might change if we decide to use 4326 as default for zoom and extent
266
- // Sanitize extent
267
- // @ts-expect-error we will need to change the approach to use
268
- // native eox-map transformation once included
269
- const b = updatedStac.extent?.spatial.bbox[0];
270
- const sanitizedExtent = [
271
- b[0] > -180 ? b[0] : -180,
272
- b[1] > -90 ? b[1] : -90,
273
- b[2] < 180 ? b[2] : 180,
274
- b[3] < 90 ? b[3] : 90,
275
- ];
276
- const reprojExtent = transformExtent(
277
- sanitizedExtent,
278
- "EPSG:4326",
279
- eoxMap.value?.map?.getView().getProjection(),
280
- );
281
- /** @type {any} */
282
- (eoxMap.value).zoomExtent = reprojExtent;
283
- }
284
- }
285
- },
286
- { immediate: true },
287
- );
288
- });
289
-
290
- onUnmounted(() => {
291
- /** @type {import('ol/Map').default} */
292
- (eoxMap.value?.map)?.un("moveend", handleMoveEnd);
293
120
  });
294
121
  </script>
@@ -1,17 +1,17 @@
1
1
  <template>
2
2
  <PopUp v-model="dialog">
3
- <v-card>
4
- <v-card-title class="bg-primary">
3
+ <v-card style="max-height: 498px">
4
+ <v-card-title class="bg-primary" style="max-height: 49px">
5
5
  <h5 class="text-h5">Storytelling map configuration</h5>
6
6
  </v-card-title>
7
7
 
8
- <v-card-text class="py-5">
8
+ <v-card-text class="py-5 overflow-auto" style="height: 400px">
9
9
  <p class="text-body-2">
10
10
  Copy and paste this code into the map layers field of the storytelling
11
11
  editor:
12
12
  </p>
13
13
  <div class="pa-3 code-block">
14
- {{ getLayers() }}
14
+ {{ removeUnneededProperties(getLayers()) }}
15
15
  </div>
16
16
 
17
17
  <div style="position: absolute; bottom: 15px">
@@ -41,7 +41,7 @@
41
41
 
42
42
  <v-divider></v-divider>
43
43
 
44
- <v-card-actions>
44
+ <v-card-actions style="max-height: 49px">
45
45
  <v-spacer></v-spacer>
46
46
  <v-btn variant="text" @click="dialog = !dialog"> Close </v-btn>
47
47
  </v-card-actions>
@@ -55,6 +55,7 @@ import { copyToClipBoard } from "@/utils";
55
55
  import { computed, ref } from "vue";
56
56
  import { getLayers as getLayerAction } from "@/store/Actions";
57
57
  import { mapPosition } from "@/store/States";
58
+ import { removeUnneededProperties } from "@/utils/helpers";
58
59
 
59
60
  const dialog = defineModel({ type: Boolean, required: true, default: false });
60
61
 
@@ -93,7 +94,7 @@ const mapStepCode = computed(() => {
93
94
  #### Tour step title
94
95
  Text describing the current step of the tour and why it is interesting what the map shows currently
95
96
  `;
96
- return `${preTag}'${JSON.stringify(props.getLayers())}' ${endTag}`;
97
+ return `${preTag}'${JSON.stringify(removeUnneededProperties(props.getLayers()))}' ${endTag}`;
97
98
  });
98
99
  const mapEntryCode = computed(() => {
99
100
  const [x, y, z] = mapPosition.value;
@@ -101,7 +102,7 @@ const mapEntryCode = computed(() => {
101
102
  "## Map Example <!" +
102
103
  '--{as="eox-map" style="width: 100%; height: 500px;" layers=';
103
104
  const endTag = `zoom="${z}" center=[${[x, y]}] }-->`;
104
- return `${preTag}'${JSON.stringify(props.getLayers())}' ${endTag}`;
105
+ return `${preTag}'${JSON.stringify(removeUnneededProperties(props.getLayers()))}' ${endTag}`;
105
106
  });
106
107
  </script>
107
108
  <style scoped>