@eeacms/volto-arcgis-block 0.1.363 → 0.1.365

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,10 @@ 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.365](https://github.com/eea/volto-arcgis-block/compare/0.1.364...0.1.365) - 28 May 2025
8
+
9
+ ### [0.1.364](https://github.com/eea/volto-arcgis-block/compare/0.1.363...0.1.364) - 28 May 2025
10
+
7
11
  ### [0.1.363](https://github.com/eea/volto-arcgis-block/compare/0.1.362...0.1.363) - 26 May 2025
8
12
 
9
13
  ### [0.1.362](https://github.com/eea/volto-arcgis-block/compare/0.1.361...0.1.362) - 21 May 2025
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.363",
3
+ "version": "0.1.365",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -60,14 +60,14 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@eeacms/volto-clms-utils": "^0.1.13",
63
+ "@eeacms/volto-taxonomy": "5.1.0",
63
64
  "@fortawesome/fontawesome-svg-core": "1.2.35",
64
65
  "@fortawesome/free-solid-svg-icons": "5.15.3",
65
66
  "@fortawesome/react-fontawesome": "0.1.14",
66
67
  "esri-loader": "3.4.0",
67
68
  "highcharts": "^9.3.2",
68
69
  "highcharts-react-official": "^3.1.0",
69
- "react-datepicker": "4.15.0",
70
- "@eeacms/volto-taxonomy": "5.1.0"
70
+ "react-datepicker": "4.15.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@cypress/code-coverage": "^3.9.5",
@@ -268,32 +268,44 @@ class AreaWidget extends React.Component {
268
268
  }, {});
269
269
  }
270
270
 
271
- createDefinitionExpressionObject(params) {
272
- if (!params || Object.keys(params).length === 0) return null;
273
- return Object.entries(params)
274
- .map(([k, v]) => {
275
- if (typeof v === 'string' && v.includes(',')) {
276
- const values = v.split(',').map((val) => `'${val.trim()}'`);
277
- if (values.length > 2) {
278
- return `${k} in (${values.join(', ')})`;
279
- } else {
280
- return values.map((val) => `${k}=${val}`).join(' OR ');
281
- }
282
- } else {
283
- return `${k}='${v}'`;
284
- }
285
- })
286
- .join(' AND ');
287
- }
271
+ // createDefinitionExpressionObject(params) {
272
+ // if (!params || Object.keys(params).length === 0) return null;
273
+ // return Object.entries(params)
274
+ // .map(([k, v]) => {
275
+ // if (typeof v === 'string' && v.includes(',')) {
276
+ // const values = v.split(',').map((val) => `'${val.trim()}'`);
277
+ // if (values.length > 2) {
278
+ // return `${k} in (${values.join(', ')})`;
279
+ // } else {
280
+ // return values.map((val) => `${k}=${val}`).join(' OR ');
281
+ // }
282
+ // } else {
283
+ // return `${k}='${v}'`;
284
+ // }
285
+ // })
286
+ // .join(' AND ');
287
+ // }
288
+
289
+ createFeatureLayer(id, baseUrl, level, customParameters) {
290
+ // Extract relevant properties from customParameters (queryParams)
291
+ const {
292
+ outFields,
293
+ returnGeometry,
294
+ returnTrueCurves,
295
+ sqlFormat,
296
+ featureEncoding,
297
+ } = customParameters;
288
298
 
289
- createFeatureLayer(id, baseUrl, level, definitionExpression) {
290
299
  return new FeatureLayer({
291
300
  id: id,
292
301
  url: baseUrl,
293
302
  layerId: level,
294
- outFields: ['*'],
303
+ outFields: outFields || ['*'],
295
304
  popupEnabled: false,
296
- definitionExpression: definitionExpression,
305
+ returnGeometry: returnGeometry || false,
306
+ returnTrueCurves: returnTrueCurves || false,
307
+ sqlFormat: sqlFormat || 'none',
308
+ featureEncoding: featureEncoding || 'esriDefault',
297
309
  });
298
310
  }
299
311
 
@@ -303,14 +315,9 @@ class AreaWidget extends React.Component {
303
315
  'flex';
304
316
  const { baseUrl, queryString } = this.getNutsUrlChunks(this.nutsUrl);
305
317
  const params = this.getNutsParams(queryString);
306
- const definitionExpression = this.createDefinitionExpressionObject(params);
318
+ // const definitionExpression = this.createDefinitionExpressionObject(params);
307
319
  levels.forEach((level) => {
308
- const layer = this.createFeatureLayer(
309
- id,
310
- baseUrl,
311
- level,
312
- definitionExpression,
313
- );
320
+ const layer = this.createFeatureLayer(id, baseUrl, level, params);
314
321
  this.nutsGroupLayer.add(layer);
315
322
  let index = this.getHighestIndex();
316
323
  this.props.map.reorder(this.nutsGroupLayer, index + 1);
@@ -4000,7 +4000,7 @@ class MenuWidget extends React.Component {
4000
4000
  if (elem.id === layerId) {
4001
4001
  this.timeLayers[elem.id] = ['fas', 'stop'];
4002
4002
  if (
4003
- this.visibleLayers[elem.id] &&
4003
+ !this.visibleLayers[elem.id] ||
4004
4004
  this.visibleLayers[elem.id][1] === 'eye-slash'
4005
4005
  ) {
4006
4006
  this.layers[elem.id].visible = true;
@@ -4398,7 +4398,7 @@ class MenuWidget extends React.Component {
4398
4398
  this.findCheckedDataset(elem);
4399
4399
  }
4400
4400
  if (
4401
- this.visibleLayers[elem.id] &&
4401
+ !this.visibleLayers[elem.id] ||
4402
4402
  this.visibleLayers[elem.id][1] === 'eye'
4403
4403
  ) {
4404
4404
  this.layers[elem.id].visible = false;