@eeacms/volto-arcgis-block 0.1.481 → 0.1.483

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.483](https://github.com/eea/volto-arcgis-block/compare/0.1.482...0.1.483) - 15 September 2026
8
+
9
+ ### [0.1.482](https://github.com/eea/volto-arcgis-block/compare/0.1.481...0.1.482) - 15 September 2026
10
+
7
11
  ### [0.1.481](https://github.com/eea/volto-arcgis-block/compare/0.1.480...0.1.481) - 14 September 2026
8
12
 
9
13
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.481",
3
+ "version": "0.1.483",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -3011,7 +3011,12 @@ class MenuWidget extends React.Component {
3011
3011
  return null;
3012
3012
  }
3013
3013
 
3014
- async applyWmtsSettingsData(layer, spatialReference, isSceneViewActive) {
3014
+ async applyWmtsSettingsData(
3015
+ layer,
3016
+ spatialReference,
3017
+ isSceneViewActive,
3018
+ useProxy = false,
3019
+ ) {
3015
3020
  if (!layer || layer.type !== 'wmts') {
3016
3021
  return true;
3017
3022
  }
@@ -3023,7 +3028,7 @@ class MenuWidget extends React.Component {
3023
3028
  let layerId = activeLayerData.id;
3024
3029
 
3025
3030
  this.xml = null;
3026
- await this.getCapabilities(serviceData, 'WMTS');
3031
+ await this.getCapabilities(serviceData, 'WMTS', { useProxy });
3027
3032
  if (!this.xml) {
3028
3033
  return !isSceneViewActive;
3029
3034
  }
@@ -3829,7 +3834,7 @@ class MenuWidget extends React.Component {
3829
3834
 
3830
3835
  if (serviceType === 'WMTS') {
3831
3836
  this.xml = null;
3832
- await this.getCapabilities(viewService, 'WMTS');
3837
+ await this.getCapabilities(viewService, 'WMTS', { useProxy: true });
3833
3838
  if (isInvalidCapabilitiesData(this.xml)) {
3834
3839
  throw new Error('Unable to load WMTS capabilities');
3835
3840
  }
@@ -3886,7 +3891,7 @@ class MenuWidget extends React.Component {
3886
3891
  }),
3887
3892
  ];
3888
3893
  } else if (isWFS) {
3889
- await this.getCapabilities(viewService, 'WFS');
3894
+ await this.getCapabilities(viewService, 'WFS', { useProxy: true });
3890
3895
  if (isInvalidCapabilitiesData(this.xml)) {
3891
3896
  throw new Error('Unable to load WFS capabilities');
3892
3897
  }
@@ -3950,7 +3955,7 @@ class MenuWidget extends React.Component {
3950
3955
  );
3951
3956
  resourceLayers = layerResults.filter(Boolean);
3952
3957
  } else {
3953
- await this.getCapabilities(viewService, 'WMS');
3958
+ await this.getCapabilities(viewService, 'WMS', { useProxy: true });
3954
3959
  if (isInvalidCapabilitiesData(this.xml)) {
3955
3960
  throw new Error('Unable to load WMS capabilities');
3956
3961
  }
@@ -4832,6 +4837,7 @@ class MenuWidget extends React.Component {
4832
4837
  this.layers[elem.id],
4833
4838
  this.view?.spatialReference,
4834
4839
  isSceneViewActive,
4840
+ !!userService,
4835
4841
  );
4836
4842
  if (!canApplyWmtsSettings) {
4837
4843
  elem.checked = false;
@@ -5202,13 +5208,6 @@ class MenuWidget extends React.Component {
5202
5208
  ) {
5203
5209
  layerToRemove.clear();
5204
5210
  }
5205
- if (
5206
- layerToRemove.type !== 'group' &&
5207
- layerToRemove.type !== 'wmts' &&
5208
- typeof layerToRemove.destroy === 'function'
5209
- ) {
5210
- layerToRemove.destroy();
5211
- }
5212
5211
  }
5213
5212
  this.map.remove(layerToRemove);
5214
5213
  if (layerIdentity) {
@@ -6194,8 +6193,9 @@ class MenuWidget extends React.Component {
6194
6193
  return BBoxes;
6195
6194
  }
6196
6195
 
6197
- getCapabilities = async (url, serviceType) => {
6198
- const proxiedUrl = this.buildProxiedUrl(url);
6196
+ getCapabilities = async (url, serviceType, options = {}) => {
6197
+ const useProxy = !!options?.useProxy;
6198
+ const targetUrl = useProxy ? this.buildProxiedUrl(url) : url;
6199
6199
  const evaluateXmlResponse = (responseData) => {
6200
6200
  const parser = new DOMParser();
6201
6201
  const xmlDoc = parser.parseFromString(responseData, 'text/xml');
@@ -6211,7 +6211,7 @@ class MenuWidget extends React.Component {
6211
6211
 
6212
6212
  const loadCapabilitiesResponse = async (requestData) => {
6213
6213
  try {
6214
- const response = await esriRequest(proxiedUrl, requestData);
6214
+ const response = await esriRequest(targetUrl, requestData);
6215
6215
  const xmlData = evaluateXmlResponse(response.data);
6216
6216
  if (xmlData) {
6217
6217
  return xmlData;
@@ -6221,8 +6221,7 @@ class MenuWidget extends React.Component {
6221
6221
  };
6222
6222
 
6223
6223
  const hasCapabilitiesEndpoint =
6224
- typeof proxiedUrl === 'string' &&
6225
- /wmtscapabilities\.xml/i.test(proxiedUrl);
6224
+ typeof targetUrl === 'string' && /wmtscapabilities\.xml/i.test(targetUrl);
6226
6225
  let xmlData = null;
6227
6226
 
6228
6227
  if (
@@ -6414,10 +6413,12 @@ class MenuWidget extends React.Component {
6414
6413
  } else if (this.url?.toLowerCase().endsWith('mapserver')) {
6415
6414
  BBoxes = await this.parseBBOXMAPSERVER(this.layers[elem.id]);
6416
6415
  } else if (this.url?.toLowerCase().includes('wms') || serviceLayer) {
6417
- await this.getCapabilities(this.url, 'wms');
6416
+ await this.getCapabilities(this.url, 'wms', { useProxy: !!serviceLayer });
6418
6417
  BBoxes = this.parseBBOXWMS(this.xml);
6419
6418
  } else if (this.url?.toLowerCase().includes('wmts')) {
6420
- await this.getCapabilities(this.url, 'wmts');
6419
+ await this.getCapabilities(this.url, 'wmts', {
6420
+ useProxy: !!serviceLayer,
6421
+ });
6421
6422
  BBoxes = this.parseBBOXWMTS(this.xml);
6422
6423
  }
6423
6424
  let myExtent;
@@ -6694,10 +6695,14 @@ class MenuWidget extends React.Component {
6694
6695
  if (this.url?.toLowerCase().endsWith('mapserver')) {
6695
6696
  BBoxes = await this.parseBBOXMAPSERVER(this.layers[elem.id]);
6696
6697
  } else if (this.url?.toLowerCase().includes('wms')) {
6697
- await this.getCapabilities(this.url, 'wms');
6698
+ await this.getCapabilities(this.url, 'wms', {
6699
+ useProxy: !!serviceLayer,
6700
+ });
6698
6701
  BBoxes = this.parseBBOXWMS(this.xml);
6699
6702
  } else if (this.url?.toLowerCase().includes('wmts')) {
6700
- await this.getCapabilities(this.url, 'wmts');
6703
+ await this.getCapabilities(this.url, 'wmts', {
6704
+ useProxy: !!serviceLayer,
6705
+ });
6701
6706
  BBoxes = this.parseBBOXWMTS(this.xml);
6702
6707
  }
6703
6708
  }