@eeacms/volto-arcgis-block 0.1.383 → 0.1.385

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/CHANGELOG.md CHANGED
@@ -4,10 +4,18 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [0.1.385](https://github.com/eea/volto-arcgis-block/compare/0.1.384...0.1.385) - 4 September 2025
8
+
9
+ ### [0.1.384](https://github.com/eea/volto-arcgis-block/compare/0.1.383...0.1.384) - 1 September 2025
10
+
11
+ #### :hammer_and_wrench: Others
12
+
13
+ - (bug): fixed hardcoded value in fetch request byoc collection id's and service endpoints become are inyected into request programmatically now [Unai Bolivar - [`aea8135`](https://github.com/eea/volto-arcgis-block/commit/aea8135868d5fef944e27d31ad4e3188ce199ff6)]
7
14
  ### [0.1.383](https://github.com/eea/volto-arcgis-block/compare/0.1.382...0.1.383) - 29 August 2025
8
15
 
9
16
  #### :hammer_and_wrench: Others
10
17
 
18
+ - Merge pull request #1007 from eea/develop [Unai Bolivar - [`4e2b9b6`](https://github.com/eea/volto-arcgis-block/commit/4e2b9b6e8fde0821243b917cde774dcf369bdc5d)]
11
19
  - (bug): implemented CDSE extent mod to full extent button in activelayers tab of the menu widget [Unai Bolivar - [`e9fdd2f`](https://github.com/eea/volto-arcgis-block/commit/e9fdd2f066d7d9cb2d2036e9e780473c751e0937)]
12
20
  ### [0.1.382](https://github.com/eea/volto-arcgis-block/compare/0.1.381...0.1.382) - 28 August 2025
13
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.383",
3
+ "version": "0.1.385",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -1697,6 +1697,7 @@ class MenuWidget extends React.Component {
1697
1697
  dataset.DatasetId,
1698
1698
  dataset.DatasetTitle,
1699
1699
  dataset.ProductId,
1700
+ dataset.dataset_download_information,
1700
1701
  ),
1701
1702
  );
1702
1703
  index++;
@@ -1952,6 +1953,7 @@ class MenuWidget extends React.Component {
1952
1953
  DatasetId,
1953
1954
  DatasetTitle,
1954
1955
  ProductId,
1956
+ dataset_download_information,
1955
1957
  ) {
1956
1958
  //For Legend request
1957
1959
  const legendRequest =
@@ -2027,6 +2029,7 @@ class MenuWidget extends React.Component {
2027
2029
  ViewService: viewService,
2028
2030
  StaticImageLegend: layer.StaticImageLegend,
2029
2031
  LayerTitle: layer.Title,
2032
+ DatasetDownloadInformation: dataset_download_information || {},
2030
2033
  customLayerParameters: {
2031
2034
  SHOWLOGO: false,
2032
2035
  },
@@ -2052,7 +2055,17 @@ class MenuWidget extends React.Component {
2052
2055
  });
2053
2056
  }
2054
2057
  }
2055
-
2058
+ // const isCDSE = !!this.url && this.url.toLowerCase().includes('/ogc/');
2059
+ // if (isCDSE) {
2060
+ // this.layers[
2061
+ // layer.LayerId + '_' + inheritedIndexLayer
2062
+ // ].datasetDownloadInformation = dataset_download_information || {};
2063
+ // this.layers[
2064
+ // layer.LayerId + '_' + inheritedIndexLayer
2065
+ // ].customLayerParameters = {
2066
+ // SHOWLOGO: false,
2067
+ // };
2068
+ // }
2056
2069
  return (
2057
2070
  <div
2058
2071
  className="ccl-form-group map-menu-layer"
@@ -2934,12 +2947,20 @@ class MenuWidget extends React.Component {
2934
2947
  if (!userService) this.checkForHotspots(elem, productContainerId);
2935
2948
  // Auto-fit extent once for OGC WMS layers on manual toggle
2936
2949
  try {
2937
- const isCDSE = !!this.url && this.url.toLowerCase().includes('/ogc/');
2950
+ // const isCDSE = !!this.url && this.url.toLowerCase().includes('/ogc/');
2951
+ const isCDSE =
2952
+ !!this.url &&
2953
+ ['/ogc/', '/cdse/'].some((s) => this.url.toLowerCase().includes(s));
2938
2954
  if (isCDSE) {
2939
- const cdseGeometry = await this.getCDSEWFSGeoCoordinates(this.url);
2955
+ const cdseGeometry = await this.getCDSEWFSGeoCoordinates(
2956
+ this.url,
2957
+ this.layers[elem.id],
2958
+ );
2940
2959
  const extent = await this.createExtentFromCoordinates(cdseGeometry);
2941
- this.view.goTo(extent);
2942
- // layer._ogcExtentApplied = true;
2960
+ this.view.goTo({
2961
+ target: extent,
2962
+ zoom: 4,
2963
+ });
2943
2964
  }
2944
2965
  } catch (e) {}
2945
2966
  // try {
@@ -3491,11 +3512,19 @@ class MenuWidget extends React.Component {
3491
3512
  });
3492
3513
  }
3493
3514
 
3494
- async getCDSEWFSGeoCoordinates(url) {
3515
+ async getCDSEWFSGeoCoordinates(url, layer) {
3495
3516
  if (!url) return {};
3496
3517
  const match = /\/ogc\/(?:wmts|wms)\/([^/?]+)/i.exec(url);
3518
+ const datasetDownloadInformation =
3519
+ layer?.DatasetDownloadInformation ||
3520
+ layer?.DatasetDownloadInformation ||
3521
+ {};
3522
+ if (!datasetDownloadInformation) return {};
3523
+ const byocCollectionId =
3524
+ datasetDownloadInformation?.items[0].byoc_collection || null;
3525
+ if (!byocCollectionId) return {};
3497
3526
  if (!match) return {};
3498
- const fetchUrl = `https://sh.dataspace.copernicus.eu/ogc/wfs/${match[1]}?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=byoc-4bd995a1-dc49-4176-a285-b1d0084ba51a&COUNT=100&BBOX=-21039383,-22375217,21039383,22375217&OUTPUTFORMAT=application/json`;
3527
+ const fetchUrl = `https://sh.dataspace.copernicus.eu/ogc/wfs/${match[1]}?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=byoc-${byocCollectionId}&COUNT=100&BBOX=-21039383,-22375217,21039383,22375217&OUTPUTFORMAT=application/json`;
3499
3528
  try {
3500
3529
  const res = await fetch(fetchUrl);
3501
3530
  const data = await res.json();
@@ -3802,12 +3831,21 @@ class MenuWidget extends React.Component {
3802
3831
  } else {
3803
3832
  this.url = serviceLayer.ViewService;
3804
3833
  }
3805
- let isCDSE = this.url?.toLowerCase().includes('/ogc/') ? true : false;
3834
+ // const isCDSE = !!this.url && this.url.toLowerCase().includes('/ogc/');
3835
+ const isCDSE =
3836
+ !!this.url &&
3837
+ ['/ogc/', '/cdse/'].some((s) => this.url.toLowerCase().includes(s));
3806
3838
  let BBoxes = {};
3807
3839
  if (isCDSE) {
3808
- const cdseGeometry = await this.getCDSEWFSGeoCoordinates(this.url);
3840
+ const cdseGeometry = await this.getCDSEWFSGeoCoordinates(
3841
+ this.url,
3842
+ this.layers[elem.id],
3843
+ );
3809
3844
  const extent = await this.createExtentFromCoordinates(cdseGeometry);
3810
- this.view.goTo(extent);
3845
+ this.view.goTo({
3846
+ target: extent,
3847
+ zoom: 4,
3848
+ });
3811
3849
  return;
3812
3850
  } else if (this.url?.toLowerCase().endsWith('mapserver')) {
3813
3851
  BBoxes = await this.parseBBOXMAPSERVER(this.layers[elem.id]);
@@ -3867,7 +3905,10 @@ class MenuWidget extends React.Component {
3867
3905
 
3868
3906
  async fullExtent(elem) {
3869
3907
  this.url = this.layers[elem.id]?.url;
3870
- const isCDSE = !!this.url && this.url.toLowerCase().includes('/ogc/');
3908
+ // const isCDSE = !!this.url && this.url.toLowerCase().includes('/ogc/');
3909
+ const isCDSE =
3910
+ !!this.url &&
3911
+ ['/ogc/', '/cdse/'].some((s) => this.url.toLowerCase().includes(s));
3871
3912
  const serviceLayer = this.state.wmsUserServiceLayers.find(
3872
3913
  (layer) => layer.LayerId === elem.id,
3873
3914
  );
@@ -3883,9 +3924,15 @@ class MenuWidget extends React.Component {
3883
3924
  let landCoverAndLandUseMapping = document.querySelector('#component_0');
3884
3925
  let productIds = [];
3885
3926
  if (isCDSE) {
3886
- const cdseGeometry = await this.getCDSEWFSGeoCoordinates(this.url);
3927
+ const cdseGeometry = await this.getCDSEWFSGeoCoordinates(
3928
+ this.url,
3929
+ this.layers[elem.id],
3930
+ );
3887
3931
  const extent = await this.createExtentFromCoordinates(cdseGeometry);
3888
- this.view.goTo(extent);
3932
+ this.view.goTo({
3933
+ target: extent,
3934
+ zoom: 4,
3935
+ });
3889
3936
  return;
3890
3937
  } else if (landCoverAndLandUseMapping) {
3891
3938
  const productElements = landCoverAndLandUseMapping.querySelectorAll(