@eeacms/volto-arcgis-block 0.1.481 → 0.1.482
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 +2 -0
- package/package.json +1 -1
- package/src/components/MapViewer/MenuWidget.jsx +26 -14
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,8 @@ 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.482](https://github.com/eea/volto-arcgis-block/compare/0.1.481...0.1.482) - 15 September 2026
|
|
8
|
+
|
|
7
9
|
### [0.1.481](https://github.com/eea/volto-arcgis-block/compare/0.1.480...0.1.481) - 14 September 2026
|
|
8
10
|
|
|
9
11
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -3011,7 +3011,12 @@ class MenuWidget extends React.Component {
|
|
|
3011
3011
|
return null;
|
|
3012
3012
|
}
|
|
3013
3013
|
|
|
3014
|
-
async applyWmtsSettingsData(
|
|
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;
|
|
@@ -6194,8 +6200,9 @@ class MenuWidget extends React.Component {
|
|
|
6194
6200
|
return BBoxes;
|
|
6195
6201
|
}
|
|
6196
6202
|
|
|
6197
|
-
getCapabilities = async (url, serviceType) => {
|
|
6198
|
-
const
|
|
6203
|
+
getCapabilities = async (url, serviceType, options = {}) => {
|
|
6204
|
+
const useProxy = !!options?.useProxy;
|
|
6205
|
+
const targetUrl = useProxy ? this.buildProxiedUrl(url) : url;
|
|
6199
6206
|
const evaluateXmlResponse = (responseData) => {
|
|
6200
6207
|
const parser = new DOMParser();
|
|
6201
6208
|
const xmlDoc = parser.parseFromString(responseData, 'text/xml');
|
|
@@ -6211,7 +6218,7 @@ class MenuWidget extends React.Component {
|
|
|
6211
6218
|
|
|
6212
6219
|
const loadCapabilitiesResponse = async (requestData) => {
|
|
6213
6220
|
try {
|
|
6214
|
-
const response = await esriRequest(
|
|
6221
|
+
const response = await esriRequest(targetUrl, requestData);
|
|
6215
6222
|
const xmlData = evaluateXmlResponse(response.data);
|
|
6216
6223
|
if (xmlData) {
|
|
6217
6224
|
return xmlData;
|
|
@@ -6221,8 +6228,7 @@ class MenuWidget extends React.Component {
|
|
|
6221
6228
|
};
|
|
6222
6229
|
|
|
6223
6230
|
const hasCapabilitiesEndpoint =
|
|
6224
|
-
typeof
|
|
6225
|
-
/wmtscapabilities\.xml/i.test(proxiedUrl);
|
|
6231
|
+
typeof targetUrl === 'string' && /wmtscapabilities\.xml/i.test(targetUrl);
|
|
6226
6232
|
let xmlData = null;
|
|
6227
6233
|
|
|
6228
6234
|
if (
|
|
@@ -6414,10 +6420,12 @@ class MenuWidget extends React.Component {
|
|
|
6414
6420
|
} else if (this.url?.toLowerCase().endsWith('mapserver')) {
|
|
6415
6421
|
BBoxes = await this.parseBBOXMAPSERVER(this.layers[elem.id]);
|
|
6416
6422
|
} else if (this.url?.toLowerCase().includes('wms') || serviceLayer) {
|
|
6417
|
-
await this.getCapabilities(this.url, 'wms');
|
|
6423
|
+
await this.getCapabilities(this.url, 'wms', { useProxy: !!serviceLayer });
|
|
6418
6424
|
BBoxes = this.parseBBOXWMS(this.xml);
|
|
6419
6425
|
} else if (this.url?.toLowerCase().includes('wmts')) {
|
|
6420
|
-
await this.getCapabilities(this.url, 'wmts'
|
|
6426
|
+
await this.getCapabilities(this.url, 'wmts', {
|
|
6427
|
+
useProxy: !!serviceLayer,
|
|
6428
|
+
});
|
|
6421
6429
|
BBoxes = this.parseBBOXWMTS(this.xml);
|
|
6422
6430
|
}
|
|
6423
6431
|
let myExtent;
|
|
@@ -6694,10 +6702,14 @@ class MenuWidget extends React.Component {
|
|
|
6694
6702
|
if (this.url?.toLowerCase().endsWith('mapserver')) {
|
|
6695
6703
|
BBoxes = await this.parseBBOXMAPSERVER(this.layers[elem.id]);
|
|
6696
6704
|
} else if (this.url?.toLowerCase().includes('wms')) {
|
|
6697
|
-
await this.getCapabilities(this.url, 'wms'
|
|
6705
|
+
await this.getCapabilities(this.url, 'wms', {
|
|
6706
|
+
useProxy: !!serviceLayer,
|
|
6707
|
+
});
|
|
6698
6708
|
BBoxes = this.parseBBOXWMS(this.xml);
|
|
6699
6709
|
} else if (this.url?.toLowerCase().includes('wmts')) {
|
|
6700
|
-
await this.getCapabilities(this.url, 'wmts'
|
|
6710
|
+
await this.getCapabilities(this.url, 'wmts', {
|
|
6711
|
+
useProxy: !!serviceLayer,
|
|
6712
|
+
});
|
|
6701
6713
|
BBoxes = this.parseBBOXWMTS(this.xml);
|
|
6702
6714
|
}
|
|
6703
6715
|
}
|