@eeacms/volto-arcgis-block 0.1.455 → 0.1.457

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,6 +4,15 @@ 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.457](https://github.com/eea/volto-arcgis-block/compare/0.1.456...0.1.457) - 17 June 2026
8
+
9
+ ### [0.1.456](https://github.com/eea/volto-arcgis-block/compare/0.1.455...0.1.456) - 11 June 2026
10
+
11
+ #### :hammer_and_wrench: Others
12
+
13
+ - CLMS-295764 (feat): loadable comented [Urkorue - [`fa3acd8`](https://github.com/eea/volto-arcgis-block/commit/fa3acd8c5827630e3e36e1d01f1339ddcfd5594c)]
14
+ - Merge pull request #1161 from eea/develop [Unai Bolivar - [`fbfa2c8`](https://github.com/eea/volto-arcgis-block/commit/fbfa2c8003581136660651ae560ed2b8a11402d2)]
15
+ - CLMS-295764 (feat): highchart comented [Urkorue - [`fde0d0d`](https://github.com/eea/volto-arcgis-block/commit/fde0d0d7aa446974f4cfc78868dc6c3dbd1cf109)]
7
16
  ### [0.1.455](https://github.com/eea/volto-arcgis-block/compare/0.1.454...0.1.455) - 9 June 2026
8
17
 
9
18
  ### [0.1.454](https://github.com/eea/volto-arcgis-block/compare/0.1.453...0.1.454) - 8 June 2026
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.455",
3
+ "version": "0.1.457",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -1,7 +1,7 @@
1
1
  import React, { createRef } from 'react';
2
2
  import { loadModules } from 'esri-loader';
3
3
  import { Loader } from 'semantic-ui-react';
4
- import loadable from '@loadable/component';
4
+ //import loadable from '@loadable/component';
5
5
  import { injectLazyLibs } from '@plone/volto/helpers/Loadable';
6
6
  // import { FontAwesomeIcon } from '@eeacms/volto-clms-utils/components';
7
7
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
@@ -10,7 +10,7 @@ var GeometryEngine, Graphic, esriRequest;
10
10
 
11
11
  // import Highcharts from 'highcharts';
12
12
 
13
- const HighchartsReact = loadable(() => import('highcharts-react-official'));
13
+ //const HighchartsReact = loadable(() => import('highcharts-react-official'));
14
14
  class InfoWidget extends React.Component {
15
15
  /**
16
16
  * Creator of the InfoWidget widget class
@@ -311,15 +311,22 @@ class InfoWidget extends React.Component {
311
311
  };
312
312
  break;
313
313
  case 'wmts':
314
- if (
315
- layers[index]?.ViewService &&
316
- layers[index].ViewService.toLowerCase().includes(
317
- 'cdse',
318
- )
319
- ) {
320
- properties = data;
314
+ // if (
315
+ // layers[index]?.ViewService &&
316
+ // layers[index].ViewService.toLowerCase().includes(
317
+ // 'cdse',
318
+ // )
319
+ // ) {
320
+ // properties = data;
321
+ // }
322
+ if (data.type === 'FeatureCollection') {
323
+ if (data.features.length) {
324
+ let obj = data.features.map((a) => {
325
+ return a.properties;
326
+ });
327
+ properties = this.transformWmtsData(obj);
328
+ }
321
329
  }
322
- properties = data;
323
330
  this.infoData[index] = {
324
331
  title: layer.title,
325
332
  data: properties,
@@ -570,14 +577,15 @@ class InfoWidget extends React.Component {
570
577
  }
571
578
 
572
579
  identifyWMTS(layer, event) {
573
- let layerId = this.getLayerName(layer);
580
+ let layerId = layer.activeLayer.id;
574
581
  let url = layer.featureInfoUrl ? layer.featureInfoUrl : layer.url;
582
+ let featureInfoUrl = url.replace('/cdse/', '/cdse/wms/');
575
583
  return this.wmsCapabilities(url).then((xml) => {
576
584
  let version = layer.version;
577
585
  let format = this.parseFormat(xml, layerId);
578
586
  let times = '';
579
587
  let nTimes = 1;
580
- return esriRequest(url, {
588
+ return esriRequest(featureInfoUrl, {
581
589
  responseType: 'html',
582
590
  sync: 'true',
583
591
  query: {
@@ -839,6 +847,49 @@ class InfoWidget extends React.Component {
839
847
  return values;
840
848
  }
841
849
 
850
+ transformWmtsData(obj) {
851
+ let values = { timeFields: {}, data: {}, variables: {}, tableData: {} };
852
+ let startField = Object.keys(obj[0]).find(
853
+ (a, i) =>
854
+ a.toUpperCase().includes('DATE') &&
855
+ !isNaN(parseInt(Object.values(obj[0])[i])),
856
+ );
857
+ values.timeFields['start'] = startField;
858
+ values.tableData['fields'] = Object.keys(obj[0]);
859
+ values.tableData['values'] = obj.map((a) => {
860
+ return Object.entries(a);
861
+ });
862
+ let fields = Object.keys(obj[0]).filter((a, i) => {
863
+ return (
864
+ !isNaN(parseInt(Object.values(obj[0])[i])) &&
865
+ a.toUpperCase() !== 'OBJECTID' &&
866
+ !a.toUpperCase().includes('DATE')
867
+ );
868
+ });
869
+ let field = fields[0];
870
+ values.variables = { options: fields, selected: field };
871
+ values.timeFields['values'] = obj.map((a, i) => {
872
+ let date = {};
873
+ Object.entries(obj[i]).forEach(([key, value]) => {
874
+ if (key === startField) {
875
+ date[key] = value;
876
+ }
877
+ });
878
+ return date;
879
+ });
880
+ values.data['outFields'] = field;
881
+ values.data['values'] = obj.map((a, i) => {
882
+ let x = {};
883
+ Object.entries(obj[i]).forEach(([key, value]) => {
884
+ if (fields.includes(key)) {
885
+ x[key] = parseFloat(value);
886
+ }
887
+ });
888
+ return x;
889
+ });
890
+ return values;
891
+ }
892
+
842
893
  addMarker(evt) {
843
894
  this.removeMarker();
844
895
  let lat = evt.mapPoint.latitude;
@@ -1367,14 +1418,14 @@ class InfoWidget extends React.Component {
1367
1418
  )}
1368
1419
  {this.state.pixelInfo && !noData && (
1369
1420
  <>
1370
- {this.loadVariableSelector(this.state.layerIndex)}
1421
+ {/* {this.loadVariableSelector(this.state.layerIndex)}
1371
1422
  {this.Highcharts && (
1372
1423
  <HighchartsReact
1373
1424
  highcharts={this.Highcharts}
1374
1425
  options={this.loadInfoChart(this.state.layerIndex)}
1375
1426
  />
1376
1427
  )}
1377
- {this.loadStatisticsSelector(this.state.layerIndex)}
1428
+ {this.loadStatisticsSelector(this.state.layerIndex)} */}
1378
1429
  {this.loadTimeInfoTable(this.state.layerIndex)}
1379
1430
  </>
1380
1431
  )}
@@ -2040,7 +2040,7 @@ class MenuWidget extends React.Component {
2040
2040
  viewService.toLowerCase().includes(segment),
2041
2041
  );
2042
2042
  const cdseLegendUrl = isCdseService
2043
- ? this.buildCdseLegendUrl(viewService, layer.Title || layer.LayerId)
2043
+ ? this.buildCdseLegendUrl(viewService, layer.LayerId || layer.Title)
2044
2044
  : null;
2045
2045
  //For each layer
2046
2046
  let inheritedIndexLayer = inheritedIndex + '_' + layerIndex;
@@ -2078,10 +2078,10 @@ class MenuWidget extends React.Component {
2078
2078
  queryable: true,
2079
2079
  visible: true,
2080
2080
  legendEnabled: true,
2081
- legendUrl: layer.StaticImageLegend
2082
- ? layer.StaticImageLegend
2083
- : cdseLegendUrl
2081
+ legendUrl: cdseLegendUrl
2084
2082
  ? cdseLegendUrl
2083
+ : layer.StaticImageLegend
2084
+ ? layer.StaticImageLegend
2085
2085
  : viewService + legendRequest + layer.LayerId,
2086
2086
  featureInfoUrl: featureInfoUrl,
2087
2087
  },
@@ -2118,7 +2118,7 @@ class MenuWidget extends React.Component {
2118
2118
  DatasetTitle: DatasetTitle,
2119
2119
  ProductId: ProductId,
2120
2120
  ViewService: viewService,
2121
- StaticImageLegend: layer.StaticImageLegend || cdseLegendUrl,
2121
+ StaticImageLegend: cdseLegendUrl || layer.StaticImageLegend,
2122
2122
  LayerTitle: layer.Title,
2123
2123
  DatasetDownloadInformation: dataset_download_information || {},
2124
2124
  customLayerParameters: {
@@ -2352,10 +2352,9 @@ class MenuWidget extends React.Component {
2352
2352
  layer: layerTitle,
2353
2353
  style: 'default',
2354
2354
  });
2355
- return (
2356
- this.getProxyBase() +
2357
- `land.copernicus.eu/cdse/${collectionMatch[1]}?${legendParams.toString()}`
2358
- );
2355
+ return `https://land.copernicus.eu/cdse/wms/${
2356
+ collectionMatch[1]
2357
+ }?${legendParams.toString()}`;
2359
2358
  }
2360
2359
 
2361
2360
  parseWMSLayers(xml) {