@eox/layercontrol 1.8.1 → 1.8.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eox/layercontrol",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  "@types/lodash.throttle": "^4.1.9",
13
13
  "@types/sortablejs": "^1.15.1",
14
14
  "ol": "^10.9.0",
15
- "vite": "^8.1.0"
15
+ "vite": "^8.2.1"
16
16
  },
17
17
  "engines": {
18
18
  "npm": ">=8.0.0",
@@ -12,6 +12,7 @@ const LAYER_EOX_CLOUDLESS = (year) => ({
12
12
  source: {
13
13
  type: "XYZ",
14
14
  url: S2MAP_URL(`s2cloudless-${year}_3857`),
15
+ attribution: `EOxCloudless <a href="https://cloudless.eox.at" target="_blank" rel="noreferrer">https://cloudless.eox.at</a> by <a href="https://eox.at" target="_blank">EOX IT Services GmbH</a> (Contains modified Copernicus Sentinel data ${year})`,
15
16
  },
16
17
  });
17
18
 
@@ -61,7 +62,7 @@ export const STORIES_LAYER_S2 = {
61
62
  properties: {
62
63
  id: "s2",
63
64
  layerControlExclusive: true,
64
- title: "s2",
65
+ title: "EOxCloudless 2024 Exploitation Ready",
65
66
  },
66
67
  style: {
67
68
  variables: {
@@ -84,9 +85,11 @@ export const STORIES_LAYER_S2 = {
84
85
  source: {
85
86
  type: "GeoTIFF",
86
87
  normalize: false,
88
+ attributions:
89
+ 'EOxCloudless <a href="https://cloudless.eox.at" target="_blank" rel="noreferrer">https://cloudless.eox.at</a> by <a href="https://eox.at" target="_blank">EOX IT Services GmbH</a> (Contains modified Copernicus Sentinel data 2024)',
87
90
  sources: [
88
91
  {
89
- url: "https://s2downloads.eox.at/demo/EOxCloudless/2020/rgbnir/s2cloudless2020-16bits_sinlge-file_z0-4.tif",
92
+ url: "https://cloudlessdownloads.eox.at/api/public/dl/jvu06wnt/exploitation-ready-epsg-4326/exploitation-ready_eoxcloudless-sentinel-2-2024_zoom-1_4bands_16bit.tif",
90
93
  },
91
94
  ],
92
95
  },
@@ -340,6 +343,7 @@ const LAYERCONFIG_LAYER_SEE = {
340
343
  maximum: 5,
341
344
  format: "range",
342
345
  default: 2,
346
+ step: 0.001,
343
347
  },
344
348
  vmax: {
345
349
  type: "number",
@@ -20,38 +20,34 @@ const dataChangeMethod = (data, tileUrlFunc, EOxLayerControlLayerConfig) => {
20
20
  /** @type {import("ol/source").Source & { getTileUrlFunction: Function, setTileUrlFunction: Function, setKey: Function, updateParams: Function, _updatedUrl: string, getUrls: Function }} */ (
21
21
  EOxLayerControlLayerConfig.layer.getSource()
22
22
  );
23
+
24
+ const removeProperties =
25
+ EOxLayerControlLayerConfig.layerConfig.schema?.options?.removeProperties ??
26
+ [];
27
+ const updatedData = { ...data };
28
+ removeProperties.forEach((prop) => delete updatedData[prop]);
29
+
23
30
  if (source.updateParams) {
24
- const updatedData = { ...data };
25
- const removeProperties =
26
- EOxLayerControlLayerConfig.layerConfig.schema?.options
27
- ?.removeProperties ?? [];
28
- removeProperties.forEach((prop) => delete updatedData[prop]);
29
31
  source.updateParams(updatedData);
30
32
  } else if (source.getTileUrlFunction && source.getTileUrlFunction()) {
31
33
  if (!newTileUrlFunc) {
32
34
  newTileUrlFunc = source.getTileUrlFunction();
33
35
  }
34
36
 
37
+ // Store the updated URL synchronously so switching to the globe reflects the change
38
+ if (source instanceof XYZ_ol) {
39
+ source._updatedUrl = updateUrl(
40
+ /** @type {XYZ_ol} */ (source).getUrls()[0],
41
+ data,
42
+ );
43
+ }
44
+
35
45
  // Setting a new tile URL function for the layer's source by applying updated data to the existing function.
36
46
  source.setTileUrlFunction((...args) => {
37
47
  const url = new URL(newTileUrlFunc(...args));
38
- const removeProperties =
39
- EOxLayerControlLayerConfig.layerConfig.schema?.options
40
- ?.removeProperties ?? [];
41
-
42
- const updatedData = { ...data };
43
- removeProperties.forEach((prop) => delete updatedData[prop]);
44
-
45
- // Store the updated URL on the source for other components (like the globe) to use
46
- if (source instanceof XYZ_ol) {
47
- source._updatedUrl = updateUrl(
48
- /** @type {XYZ_ol} */ (source).getUrls()[0],
49
- updatedData,
50
- );
51
- }
52
48
  // Remove unwanted properties from query parameters
53
49
  removeProperties.forEach((prop) => url.searchParams.delete(prop));
54
- return updateUrl(url.href, updatedData);
50
+ return updateUrl(url.href, data);
55
51
  });
56
52
 
57
53
  // TODO: It's not advisable to access protected methods directly.
@@ -65,17 +61,11 @@ const dataChangeMethod = (data, tileUrlFunc, EOxLayerControlLayerConfig) => {
65
61
  if (map) {
66
62
  const globe = map.globe;
67
63
  if (globe) {
68
- const updatedData = { ...data };
69
- const removeProperties =
70
- EOxLayerControlLayerConfig.layerConfig.schema?.options
71
- ?.removeProperties ?? [];
72
- removeProperties.forEach((prop) => delete updatedData[prop]);
73
-
74
64
  const globusLayer = globe.planet.layers.filter(
75
65
  (l) => l.name == EOxLayerControlLayerConfig.layer.get("id"),
76
66
  )[0];
77
67
  if (globusLayer) {
78
- globusLayer.setUrl(updateUrl(globusLayer.url, updatedData));
68
+ globusLayer.setUrl(updateUrl(globusLayer.url, data));
79
69
  }
80
70
  window.eoxMapGlobe.refresh();
81
71
  }
@@ -86,6 +86,8 @@ export namespace STORIES_LAYER_S2 {
86
86
  let type_7: string;
87
87
  export { type_7 as type };
88
88
  export let normalize: boolean;
89
+ let attributions_1: string;
90
+ export { attributions_1 as attributions };
89
91
  export let sources: {
90
92
  url: string;
91
93
  }[];
@@ -143,6 +145,7 @@ export namespace STORIES_LAYER_EOX_CLOUDLESS_2019 {
143
145
  export { type_13 as type };
144
146
  let url_2: string;
145
147
  export { url_2 as url };
148
+ export let attribution: string;
146
149
  }
147
150
  export { source_6 as source };
148
151
  }
@@ -178,6 +181,7 @@ export const STORIES_MAIN_MAP_LAYERS: ({
178
181
  source: {
179
182
  type: string;
180
183
  normalize: boolean;
184
+ attributions: string;
181
185
  sources: {
182
186
  url: string;
183
187
  }[];
@@ -902,6 +906,8 @@ declare namespace LAYERCONFIG_LAYER_SEE {
902
906
  export { format_16 as format };
903
907
  let _default_15: number;
904
908
  export { _default_15 as default };
909
+ let step_2: number;
910
+ export { step_2 as step };
905
911
  }
906
912
  export { vmin_5 as vmin };
907
913
  export namespace vmax_5 {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/enums/stories/index.js"],"names":[],"mappings":"AAiBA,yCAA0C,eAAe,CAAC;AAE1D,gCACE,gDAAgD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuBE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAjJF,gCACE,gFAAgF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4LnF;;;;;;;;;;EA2DE;0BA1PwB,6BAA6B"}
@@ -1 +1 @@
1
- {"version":3,"file":"data-change.d.ts","sourceRoot":"","sources":["../../../src/methods/layer-config/data-change.js"],"names":[],"mappings":";AAGA;;;;;;;;GAQG;AACH,wCALW;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,qDAEpB,OAAO,+BAA+B,EAAE,0BAA0B,YA2E5E"}
1
+ {"version":3,"file":"data-change.d.ts","sourceRoot":"","sources":["../../../src/methods/layer-config/data-change.js"],"names":[],"mappings":";AAGA;;;;;;;;GAQG;AACH,wCALW;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,qDAEpB,OAAO,+BAA+B,EAAE,0BAA0B,YAiE5E"}