@eeacms/volto-arcgis-block 0.1.449 → 0.1.451
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,14 @@ 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.451](https://github.com/eea/volto-arcgis-block/compare/0.1.450...0.1.451) - 21 May 2026
|
|
8
|
+
|
|
9
|
+
### [0.1.450](https://github.com/eea/volto-arcgis-block/compare/0.1.449...0.1.450) - 13 May 2026
|
|
10
|
+
|
|
11
|
+
#### :hammer_and_wrench: Others
|
|
12
|
+
|
|
13
|
+
- (bug): fix swipe, hotspot filter, TOC CDSE [Unai Bolivar - [`0065fef`](https://github.com/eea/volto-arcgis-block/commit/0065fef63b0690aac79472d2b97b06243ccfa123)]
|
|
14
|
+
- (bug): swipe fix [Unai Bolivar - [`685648f`](https://github.com/eea/volto-arcgis-block/commit/685648f17cfa38ddc8bad66aaba9ee0165f7410e)]
|
|
7
15
|
### [0.1.449](https://github.com/eea/volto-arcgis-block/compare/0.1.448...0.1.449) - 12 May 2026
|
|
8
16
|
|
|
9
17
|
### [0.1.448](https://github.com/eea/volto-arcgis-block/compare/0.1.447...0.1.448) - 11 May 2026
|
package/package.json
CHANGED
|
@@ -596,9 +596,9 @@ class HotspotWidget extends React.Component {
|
|
|
596
596
|
if (lcContainer === null || lccContainer === null) return;
|
|
597
597
|
if (
|
|
598
598
|
(lcContainer.style.display === 'block' &&
|
|
599
|
-
lcTimeSelect.value === 'default') ||
|
|
599
|
+
(lcTimeSelect.value === 'default' || lcTimeSelect.value === '')) ||
|
|
600
600
|
(lccContainer.style.display === 'block' &&
|
|
601
|
-
lccTimeSelect.value === 'default') ||
|
|
601
|
+
(lccTimeSelect.value === 'default' || lccTimeSelect.value === '')) ||
|
|
602
602
|
klcSelect.value === 'default'
|
|
603
603
|
) {
|
|
604
604
|
document.querySelector('#applyFilterButton').disabled = true;
|
|
@@ -759,10 +759,20 @@ class HotspotWidget extends React.Component {
|
|
|
759
759
|
} else {
|
|
760
760
|
selectBox.value = this.state.selectedArea;
|
|
761
761
|
if (this.state.lcYear !== null) {
|
|
762
|
-
|
|
762
|
+
const hasLcYearOption = Array.from(
|
|
763
|
+
selectBoxLcTime.options,
|
|
764
|
+
).some((option) => option.value === this.state.lcYear);
|
|
765
|
+
selectBoxLcTime.value = hasLcYearOption
|
|
766
|
+
? this.state.lcYear
|
|
767
|
+
: 'default';
|
|
763
768
|
}
|
|
764
769
|
if (this.state.lccYear !== null) {
|
|
765
|
-
|
|
770
|
+
const hasLccYearOption = Array.from(
|
|
771
|
+
selectBoxLccTime.options,
|
|
772
|
+
).some((option) => option.value === this.state.lccYear);
|
|
773
|
+
selectBoxLccTime.value = hasLccYearOption
|
|
774
|
+
? this.state.lccYear
|
|
775
|
+
: 'default';
|
|
766
776
|
}
|
|
767
777
|
break; // move break statement inside the if block
|
|
768
778
|
}
|
|
@@ -783,10 +793,20 @@ class HotspotWidget extends React.Component {
|
|
|
783
793
|
} else {
|
|
784
794
|
selectBox.value = this.state.selectedArea;
|
|
785
795
|
if (this.state.lcYear !== null) {
|
|
786
|
-
|
|
796
|
+
const hasLcYearOption = Array.from(
|
|
797
|
+
selectBoxLcTime.options,
|
|
798
|
+
).some((option) => option.value === this.state.lcYear);
|
|
799
|
+
selectBoxLcTime.value = hasLcYearOption
|
|
800
|
+
? this.state.lcYear
|
|
801
|
+
: 'default';
|
|
787
802
|
}
|
|
788
803
|
if (this.state.lccYear !== null) {
|
|
789
|
-
|
|
804
|
+
const hasLccYearOption = Array.from(
|
|
805
|
+
selectBoxLccTime.options,
|
|
806
|
+
).some((option) => option.value === this.state.lccYear);
|
|
807
|
+
selectBoxLccTime.value = hasLccYearOption
|
|
808
|
+
? this.state.lccYear
|
|
809
|
+
: 'default';
|
|
790
810
|
}
|
|
791
811
|
break;
|
|
792
812
|
}
|
|
@@ -155,9 +155,10 @@ class InfoWidget extends React.Component {
|
|
|
155
155
|
fields: layer.fields,
|
|
156
156
|
});
|
|
157
157
|
promises.push(
|
|
158
|
-
this.cdseCapabilities(layer.ViewService, layer).then((xml) =>
|
|
159
|
-
|
|
160
|
-
),
|
|
158
|
+
// this.cdseCapabilities(layer.ViewService, layer).then((xml) =>
|
|
159
|
+
// this.identifyCDSE(xml, layer),
|
|
160
|
+
// ),
|
|
161
|
+
this.identifyWMTS(layer, e),
|
|
161
162
|
);
|
|
162
163
|
} else if (layer.url.toLowerCase().includes('wms')) {
|
|
163
164
|
layerTypes.push({
|
|
@@ -540,7 +541,73 @@ class InfoWidget extends React.Component {
|
|
|
540
541
|
QUERY_LAYERS: layerId,
|
|
541
542
|
LAYERS: layerId,
|
|
542
543
|
INFO_FORMAT: format,
|
|
543
|
-
TIME:
|
|
544
|
+
TIME:
|
|
545
|
+
layer.customLayerParameters && layer.customLayerParameters['TIME']
|
|
546
|
+
? layer.customLayerParameters['TIME']
|
|
547
|
+
: times
|
|
548
|
+
? times[nTimes - 1] + '/' + times[nTimes - 1]
|
|
549
|
+
: '',
|
|
550
|
+
FEATURE_COUNT: '' + nTimes,
|
|
551
|
+
},
|
|
552
|
+
})
|
|
553
|
+
.then((response) => {
|
|
554
|
+
let format = response.requestOptions.query.INFO_FORMAT;
|
|
555
|
+
let data;
|
|
556
|
+
if (format.includes('text')) {
|
|
557
|
+
data = new window.DOMParser().parseFromString(
|
|
558
|
+
response.data,
|
|
559
|
+
'text/html',
|
|
560
|
+
);
|
|
561
|
+
} else if (format.includes('json')) {
|
|
562
|
+
data = JSON.parse(response.data);
|
|
563
|
+
}
|
|
564
|
+
return data; // Added return statement
|
|
565
|
+
})
|
|
566
|
+
.then((data) => {
|
|
567
|
+
return data;
|
|
568
|
+
});
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
identifyWMTS(layer, event) {
|
|
573
|
+
let layerId = this.getLayerName(layer);
|
|
574
|
+
let url = layer.featureInfoUrl ? layer.featureInfoUrl : layer.url;
|
|
575
|
+
return this.wmsCapabilities(url).then((xml) => {
|
|
576
|
+
let version = layer.version;
|
|
577
|
+
let format = this.parseFormat(xml, layerId);
|
|
578
|
+
let times = '';
|
|
579
|
+
let nTimes = 1;
|
|
580
|
+
return esriRequest(url, {
|
|
581
|
+
responseType: 'html',
|
|
582
|
+
sync: 'true',
|
|
583
|
+
query: {
|
|
584
|
+
request: 'GetFeatureInfo',
|
|
585
|
+
service: 'WMS',
|
|
586
|
+
version: version,
|
|
587
|
+
SRS: 'EPSG:' + this.props.view.spatialReference.latestWkid,
|
|
588
|
+
CRS: 'EPSG:' + this.props.view.spatialReference.latestWkid,
|
|
589
|
+
BBOX:
|
|
590
|
+
'' +
|
|
591
|
+
this.props.view.extent.xmin +
|
|
592
|
+
', ' +
|
|
593
|
+
this.props.view.extent.ymin +
|
|
594
|
+
', ' +
|
|
595
|
+
this.props.view.extent.xmax +
|
|
596
|
+
', ' +
|
|
597
|
+
this.props.view.extent.ymax,
|
|
598
|
+
HEIGHT: this.props.view.height,
|
|
599
|
+
WIDTH: this.props.view.width,
|
|
600
|
+
X: Math.round(event.screenPoint.x),
|
|
601
|
+
Y: Math.round(event.screenPoint.y),
|
|
602
|
+
QUERY_LAYERS: layerId,
|
|
603
|
+
LAYERS: layerId,
|
|
604
|
+
INFO_FORMAT: format,
|
|
605
|
+
TIME:
|
|
606
|
+
layer.customLayerParameters && layer.customLayerParameters['TIME']
|
|
607
|
+
? layer.customLayerParameters['TIME']
|
|
608
|
+
: times
|
|
609
|
+
? times[nTimes - 1] + '/' + times[nTimes - 1]
|
|
610
|
+
: '',
|
|
544
611
|
FEATURE_COUNT: '' + nTimes,
|
|
545
612
|
},
|
|
546
613
|
})
|
|
@@ -2068,10 +2068,14 @@ class MenuWidget extends React.Component {
|
|
|
2068
2068
|
ViewService: viewService,
|
|
2069
2069
|
});
|
|
2070
2070
|
} else if (viewService?.toLowerCase().includes('wmts')) {
|
|
2071
|
+
const resolveSentinelLayer = /(?:sh\.dataspace\.copernicus\.eu|services\.sentinel-hub\.com)\/ogc\/wmts/i.test(
|
|
2072
|
+
viewService || '',
|
|
2073
|
+
);
|
|
2071
2074
|
this.layers[layer.LayerId + '_' + inheritedIndexLayer] = new WMTSLayer({
|
|
2072
2075
|
url: viewService?.includes('?')
|
|
2073
2076
|
? viewService + '&'
|
|
2074
2077
|
: viewService + '?',
|
|
2078
|
+
serviceMode: 'KVP',
|
|
2075
2079
|
spatialReference: this.view?.spatialReference,
|
|
2076
2080
|
//id: layer.LayerId,
|
|
2077
2081
|
title: '',
|
|
@@ -2092,6 +2096,7 @@ class MenuWidget extends React.Component {
|
|
|
2092
2096
|
DatasetDownloadInformation: dataset_download_information || {},
|
|
2093
2097
|
customLayerParameters: {
|
|
2094
2098
|
SHOWLOGO: false,
|
|
2099
|
+
...(resolveSentinelLayer ? { PREVIEW: 2 } : {}),
|
|
2095
2100
|
},
|
|
2096
2101
|
});
|
|
2097
2102
|
} else {
|
|
@@ -2703,6 +2708,18 @@ class MenuWidget extends React.Component {
|
|
|
2703
2708
|
if (!activeLayerData) {
|
|
2704
2709
|
return false;
|
|
2705
2710
|
}
|
|
2711
|
+
const resolveSentinelLayer = /(?:sh\.dataspace\.copernicus\.eu|services\.sentinel-hub\.com)\/ogc\/wmts/i.test(
|
|
2712
|
+
(
|
|
2713
|
+
currentLayerData.ViewService ||
|
|
2714
|
+
currentLayerData.url ||
|
|
2715
|
+
''
|
|
2716
|
+
).toLowerCase(),
|
|
2717
|
+
);
|
|
2718
|
+
const nextCustomLayerParameters = {
|
|
2719
|
+
...(currentLayerData.customLayerParameters || {}),
|
|
2720
|
+
SHOWLOGO: false,
|
|
2721
|
+
...(resolveSentinelLayer ? { PREVIEW: 2 } : {}),
|
|
2722
|
+
};
|
|
2706
2723
|
|
|
2707
2724
|
const nextLayerData = new WMTSLayer({
|
|
2708
2725
|
id: currentLayerData.id || layerId,
|
|
@@ -2714,9 +2731,7 @@ class MenuWidget extends React.Component {
|
|
|
2714
2731
|
this.view?.spatialReference || currentLayerData.spatialReference,
|
|
2715
2732
|
activeLayer: activeLayerData,
|
|
2716
2733
|
ViewService: currentLayerData.ViewService || currentLayerData.url,
|
|
2717
|
-
customLayerParameters:
|
|
2718
|
-
SHOWLOGO: false,
|
|
2719
|
-
},
|
|
2734
|
+
customLayerParameters: nextCustomLayerParameters,
|
|
2720
2735
|
});
|
|
2721
2736
|
|
|
2722
2737
|
const customKeys = [
|
|
@@ -4444,8 +4459,23 @@ class MenuWidget extends React.Component {
|
|
|
4444
4459
|
if (
|
|
4445
4460
|
this.layers[elem.id].ViewService.toLowerCase().includes('wmts')
|
|
4446
4461
|
) {
|
|
4462
|
+
const resolveSentinelLayer = /(?:sh\.dataspace\.copernicus\.eu|services\.sentinel-hub\.com)\/ogc\/wmts/i.test(
|
|
4463
|
+
this.layers[elem.id].ViewService ||
|
|
4464
|
+
this.layers[elem.id].url ||
|
|
4465
|
+
'',
|
|
4466
|
+
);
|
|
4467
|
+
const nextCustomLayerParameters = {
|
|
4468
|
+
...(this.layers[elem.id].customLayerParameters || {}),
|
|
4469
|
+
SHOWLOGO: false,
|
|
4470
|
+
...(resolveSentinelLayer ? { PREVIEW: 2 } : {}),
|
|
4471
|
+
TIME:
|
|
4472
|
+
payload.dates[payload.dates.length - 1] +
|
|
4473
|
+
'/' +
|
|
4474
|
+
payload.dates[payload.dates.length - 1] || '',
|
|
4475
|
+
};
|
|
4447
4476
|
this.layers[elem.id] = new WMTSLayer({
|
|
4448
4477
|
url: this.layers[elem.id].url,
|
|
4478
|
+
serviceMode: this.layers[elem.id].serviceMode || 'KVP',
|
|
4449
4479
|
spatialReference: this.layers[elem.id].spatialReference,
|
|
4450
4480
|
title: this.layers[elem.id].title,
|
|
4451
4481
|
_wmtsTitle: this.layers[elem.id]._wmtsTitle,
|
|
@@ -4460,13 +4490,7 @@ class MenuWidget extends React.Component {
|
|
|
4460
4490
|
LayerTitle: this.layers[elem.id].LayerTitle,
|
|
4461
4491
|
DatasetDownloadInformation: this.layers[elem.id]
|
|
4462
4492
|
.DatasetDownloadInformation,
|
|
4463
|
-
customLayerParameters:
|
|
4464
|
-
SHOWLOGO: false,
|
|
4465
|
-
TIME:
|
|
4466
|
-
payload.dates[payload.dates.length - 1] +
|
|
4467
|
-
'/' +
|
|
4468
|
-
payload.dates[payload.dates.length - 1] || '',
|
|
4469
|
-
},
|
|
4493
|
+
customLayerParameters: nextCustomLayerParameters,
|
|
4470
4494
|
});
|
|
4471
4495
|
}
|
|
4472
4496
|
}
|
|
@@ -4632,26 +4656,97 @@ class MenuWidget extends React.Component {
|
|
|
4632
4656
|
sessionStorage.removeItem('downloadButtonClicked');
|
|
4633
4657
|
sessionStorage.removeItem('timeSliderTag');
|
|
4634
4658
|
this.deleteCheckedLayer(elem.id);
|
|
4635
|
-
this.layers[elem.id]
|
|
4636
|
-
|
|
4659
|
+
const currentLayerData = this.layers[elem.id];
|
|
4660
|
+
currentLayerData.opacity = 1;
|
|
4661
|
+
currentLayerData.visible = false;
|
|
4637
4662
|
if (!userService) this.deleteFilteredLayer(elem.id);
|
|
4638
|
-
|
|
4663
|
+
const mapLayersToRemove = [];
|
|
4664
|
+
const mapLayer = this.map.findLayerById(elem.id);
|
|
4639
4665
|
if (mapLayer) {
|
|
4666
|
+
mapLayersToRemove.push(mapLayer);
|
|
4667
|
+
}
|
|
4668
|
+
if (
|
|
4669
|
+
currentLayerData &&
|
|
4670
|
+
this.map &&
|
|
4671
|
+
this.map.layers &&
|
|
4672
|
+
typeof this.map.layers.includes === 'function' &&
|
|
4673
|
+
this.map.layers.includes(currentLayerData)
|
|
4674
|
+
) {
|
|
4675
|
+
mapLayersToRemove.push(currentLayerData);
|
|
4676
|
+
}
|
|
4677
|
+
const currentLayerService = String(
|
|
4678
|
+
currentLayerData?.ViewService || currentLayerData?.url || '',
|
|
4679
|
+
).toLowerCase();
|
|
4680
|
+
const currentLayerActive = currentLayerData?.activeLayer?.id || null;
|
|
4681
|
+
const currentLayerDataset = currentLayerData?.DatasetId || null;
|
|
4682
|
+
const mapLayerItems = this.map?.layers?.items || [];
|
|
4683
|
+
mapLayerItems.forEach((candidateLayer) => {
|
|
4684
|
+
if (!candidateLayer) {
|
|
4685
|
+
return;
|
|
4686
|
+
}
|
|
4687
|
+
if (candidateLayer === currentLayerData) {
|
|
4688
|
+
mapLayersToRemove.push(candidateLayer);
|
|
4689
|
+
return;
|
|
4690
|
+
}
|
|
4691
|
+
if (
|
|
4692
|
+
candidateLayer.LayerId === elem.id ||
|
|
4693
|
+
candidateLayer.id === elem.id
|
|
4694
|
+
) {
|
|
4695
|
+
mapLayersToRemove.push(candidateLayer);
|
|
4696
|
+
return;
|
|
4697
|
+
}
|
|
4698
|
+
const candidateService = String(
|
|
4699
|
+
candidateLayer.ViewService || candidateLayer.url || '',
|
|
4700
|
+
).toLowerCase();
|
|
4701
|
+
if (!currentLayerService || currentLayerService !== candidateService) {
|
|
4702
|
+
return;
|
|
4703
|
+
}
|
|
4704
|
+
if (
|
|
4705
|
+
currentLayerActive &&
|
|
4706
|
+
candidateLayer.activeLayer &&
|
|
4707
|
+
candidateLayer.activeLayer.id === currentLayerActive
|
|
4708
|
+
) {
|
|
4709
|
+
mapLayersToRemove.push(candidateLayer);
|
|
4710
|
+
return;
|
|
4711
|
+
}
|
|
4712
|
+
if (
|
|
4713
|
+
currentLayerDataset &&
|
|
4714
|
+
candidateLayer.DatasetId &&
|
|
4715
|
+
candidateLayer.DatasetId === currentLayerDataset
|
|
4716
|
+
) {
|
|
4717
|
+
mapLayersToRemove.push(candidateLayer);
|
|
4718
|
+
}
|
|
4719
|
+
});
|
|
4720
|
+
const removedLayerIds = new Set();
|
|
4721
|
+
mapLayersToRemove.forEach((layerToRemove) => {
|
|
4722
|
+
if (!layerToRemove) {
|
|
4723
|
+
return;
|
|
4724
|
+
}
|
|
4725
|
+
const layerIdentity = layerToRemove.uid || layerToRemove.id;
|
|
4726
|
+
if (layerIdentity && removedLayerIds.has(layerIdentity)) {
|
|
4727
|
+
return;
|
|
4728
|
+
}
|
|
4640
4729
|
if (!userService) {
|
|
4641
4730
|
if (
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4731
|
+
layerToRemove.type &&
|
|
4732
|
+
layerToRemove.type !== 'base-tile' &&
|
|
4733
|
+
layerToRemove.type !== 'wmts' &&
|
|
4734
|
+
typeof layerToRemove.clear === 'function'
|
|
4735
|
+
) {
|
|
4736
|
+
layerToRemove.clear();
|
|
4737
|
+
}
|
|
4738
|
+
if (
|
|
4739
|
+
layerToRemove.type !== 'wmts' &&
|
|
4740
|
+
typeof layerToRemove.destroy === 'function'
|
|
4741
|
+
) {
|
|
4742
|
+
layerToRemove.destroy();
|
|
4649
4743
|
}
|
|
4650
|
-
this.map.remove(this.layers[elem.id]);
|
|
4651
|
-
} else {
|
|
4652
|
-
this.map.remove(mapLayer);
|
|
4653
4744
|
}
|
|
4654
|
-
|
|
4745
|
+
this.map.remove(layerToRemove);
|
|
4746
|
+
if (layerIdentity) {
|
|
4747
|
+
removedLayerIds.add(layerIdentity);
|
|
4748
|
+
}
|
|
4749
|
+
});
|
|
4655
4750
|
if (this.uploadedGraphics && this.uploadedGraphics[elem.id]) {
|
|
4656
4751
|
try {
|
|
4657
4752
|
this.view.graphics.removeMany(this.uploadedGraphics[elem.id]);
|
|
@@ -152,8 +152,9 @@ class SwipeWidget extends React.Component {
|
|
|
152
152
|
// CLOSE
|
|
153
153
|
this.props.mapViewer.setActiveWidget();
|
|
154
154
|
this.cleanupSwipeState();
|
|
155
|
-
this.
|
|
155
|
+
this.removeLayerChangeListener();
|
|
156
156
|
this.cleanupSwipeResource();
|
|
157
|
+
this.loadVisibleLayers();
|
|
157
158
|
this.setState({ showMapMenu: false });
|
|
158
159
|
if (shouldReturnToThreeDimensionalView) {
|
|
159
160
|
this.props.mapViewer.switchViewMode('3d');
|
|
@@ -434,11 +435,15 @@ class SwipeWidget extends React.Component {
|
|
|
434
435
|
let cl = JSON.parse(sessionStorage.getItem('checkedLayers'));
|
|
435
436
|
if (cl) {
|
|
436
437
|
cl.forEach((layer) => {
|
|
437
|
-
|
|
438
|
-
|
|
438
|
+
const selectedLayer = layers[layer];
|
|
439
|
+
if (!selectedLayer) {
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
if (selectedLayer.id === selectedLeadingLayer) {
|
|
443
|
+
this.swipe.leadingLayers.add(selectedLayer);
|
|
439
444
|
}
|
|
440
|
-
if (
|
|
441
|
-
this.swipe.trailingLayers.add(
|
|
445
|
+
if (selectedLayer.id === selectedTrailingLayer) {
|
|
446
|
+
this.swipe.trailingLayers.add(selectedLayer);
|
|
442
447
|
}
|
|
443
448
|
});
|
|
444
449
|
}
|
|
@@ -488,7 +493,9 @@ class SwipeWidget extends React.Component {
|
|
|
488
493
|
let cl = JSON.parse(sessionStorage.getItem('checkedLayers'));
|
|
489
494
|
if (cl) {
|
|
490
495
|
cl.forEach((layer) => {
|
|
491
|
-
|
|
496
|
+
if (layers[layer]) {
|
|
497
|
+
this.map.layers.add(layers[layer]);
|
|
498
|
+
}
|
|
492
499
|
});
|
|
493
500
|
}
|
|
494
501
|
if (layers['lcc_filter']) {
|