@eeacms/volto-arcgis-block 0.1.413 → 0.1.414
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 +10 -0
- package/package.json +1 -1
- package/src/components/MapViewer/MenuWidget.jsx +126 -8
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,18 @@ 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.414](https://github.com/eea/volto-arcgis-block/compare/0.1.413...0.1.414) - 1 December 2025
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- (bug): Refactor setOpacity to update localstorage correctly [Unai Bolivar - [`b285628`](https://github.com/eea/volto-arcgis-block/commit/b285628caf26c91bbe4f94db48e7406e36f906a6)]
|
|
12
|
+
- (bug): Refactor menu deselection updating the map view [Unai Bolivar - [`01c3b52`](https://github.com/eea/volto-arcgis-block/commit/01c3b520d5679d67b8459ac68a9ca4d14522e67d)]
|
|
13
|
+
- (bug): Adding peesistence to extent mechanisms for HRVPP datasets. Unstable. [Unai Bolivar - [`c5c491f`](https://github.com/eea/volto-arcgis-block/commit/c5c491f1c46ce62ccfe90830c3949db2bb2d4831)]
|
|
7
14
|
### [0.1.413](https://github.com/eea/volto-arcgis-block/compare/0.1.412...0.1.413) - 27 November 2025
|
|
8
15
|
|
|
16
|
+
#### :hammer_and_wrench: Others
|
|
17
|
+
|
|
18
|
+
- Merge pull request #1068 from eea/develop [Unai Bolivar - [`cf8a1b1`](https://github.com/eea/volto-arcgis-block/commit/cf8a1b1f0c90dba13ff68f971e01690c52d57453)]
|
|
9
19
|
### [0.1.412](https://github.com/eea/volto-arcgis-block/compare/0.1.411...0.1.412) - 26 November 2025
|
|
10
20
|
|
|
11
21
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -463,6 +463,7 @@ class MenuWidget extends React.Component {
|
|
|
463
463
|
this.xml = null;
|
|
464
464
|
this.dataBBox = null;
|
|
465
465
|
this.extentInitiated = false;
|
|
466
|
+
this.extentCenter = null;
|
|
466
467
|
this.hotspotLayerIds = [];
|
|
467
468
|
this.getHotspotLayerIds = this.getHotspotLayerIds.bind(this);
|
|
468
469
|
this.prepareHotspotLayers = this.prepareHotspotLayers.bind(this);
|
|
@@ -476,7 +477,11 @@ class MenuWidget extends React.Component {
|
|
|
476
477
|
this.view.watch('stationary', (isStationary) => {
|
|
477
478
|
let snowAndIceInSessionStorage = sessionStorage.getItem('snowAndIce');
|
|
478
479
|
let node;
|
|
480
|
+
if (this.view && this.view.center) {
|
|
481
|
+
this.extentCenter = { x: this.view.center.x, y: this.view.center.y };
|
|
482
|
+
}
|
|
479
483
|
if (isStationary) {
|
|
484
|
+
this.extentInitiated = false;
|
|
480
485
|
let zoom = this.view.get('zoom');
|
|
481
486
|
if (this.props.download) {
|
|
482
487
|
node = document.querySelector('.zoom-in-message-dataset');
|
|
@@ -2892,6 +2897,12 @@ class MenuWidget extends React.Component {
|
|
|
2892
2897
|
// }, 2000);
|
|
2893
2898
|
}
|
|
2894
2899
|
}
|
|
2900
|
+
if (
|
|
2901
|
+
this.layers[elem.id].DatasetId === '65f8eded11d94a1ba5540ceecaddd4e6' ||
|
|
2902
|
+
this.layers[elem.id].DatasetId === '40e056d02eed4c1fb2040cf0f06823df'
|
|
2903
|
+
) {
|
|
2904
|
+
this.fullExtentDataset(elem);
|
|
2905
|
+
}
|
|
2895
2906
|
if (
|
|
2896
2907
|
(elem.id.includes('all_lcc') || elem.id.includes('all_present')) &&
|
|
2897
2908
|
(this.layers['lc_filter'] || this.layers['lcc_filter']) &&
|
|
@@ -3028,6 +3039,7 @@ class MenuWidget extends React.Component {
|
|
|
3028
3039
|
}
|
|
3029
3040
|
} catch (e) {}
|
|
3030
3041
|
} else {
|
|
3042
|
+
this.extentInitiated = false;
|
|
3031
3043
|
sessionStorage.removeItem('downloadButtonClicked');
|
|
3032
3044
|
sessionStorage.removeItem('timeSliderTag');
|
|
3033
3045
|
this.deleteCheckedLayer(elem.id);
|
|
@@ -3305,6 +3317,29 @@ class MenuWidget extends React.Component {
|
|
|
3305
3317
|
this.toggleLayer(element);
|
|
3306
3318
|
}
|
|
3307
3319
|
});
|
|
3320
|
+
if (!value) {
|
|
3321
|
+
let filterIds = ['lcc_filter', 'lc_filter', 'klc_filter', 'pa_filter'];
|
|
3322
|
+
for (let i = 0; i < filterIds.length; i++) {
|
|
3323
|
+
let fid = filterIds[i];
|
|
3324
|
+
if (this.layers && this.layers[fid]) {
|
|
3325
|
+
this.deleteFilteredLayer(fid);
|
|
3326
|
+
let mapLayer = this.map && this.map.findLayerById(fid);
|
|
3327
|
+
if (mapLayer) {
|
|
3328
|
+
if (mapLayer.type && mapLayer.type !== 'base-tile') {
|
|
3329
|
+
mapLayer.clear();
|
|
3330
|
+
}
|
|
3331
|
+
mapLayer.destroy();
|
|
3332
|
+
this.map.remove(mapLayer);
|
|
3333
|
+
}
|
|
3334
|
+
if (this.activeLayersJSON && this.activeLayersJSON[fid])
|
|
3335
|
+
delete this.activeLayersJSON[fid];
|
|
3336
|
+
if (this.visibleLayers && this.visibleLayers[fid])
|
|
3337
|
+
delete this.visibleLayers[fid];
|
|
3338
|
+
if (this.timeLayers && this.timeLayers[fid])
|
|
3339
|
+
delete this.timeLayers[fid];
|
|
3340
|
+
}
|
|
3341
|
+
}
|
|
3342
|
+
}
|
|
3308
3343
|
}
|
|
3309
3344
|
|
|
3310
3345
|
/**
|
|
@@ -4040,8 +4075,9 @@ class MenuWidget extends React.Component {
|
|
|
4040
4075
|
});
|
|
4041
4076
|
}
|
|
4042
4077
|
if (
|
|
4043
|
-
this.
|
|
4044
|
-
this.layers[elem.id].DatasetId === '
|
|
4078
|
+
this.extentInitiated === false &&
|
|
4079
|
+
(this.layers[elem.id].DatasetId === '65f8eded11d94a1ba5540ceecaddd4e6' ||
|
|
4080
|
+
this.layers[elem.id].DatasetId === '40e056d02eed4c1fb2040cf0f06823df')
|
|
4045
4081
|
) {
|
|
4046
4082
|
let myExtent = new Extent({
|
|
4047
4083
|
xmin: -13478905.5678019,
|
|
@@ -4050,7 +4086,20 @@ class MenuWidget extends React.Component {
|
|
|
4050
4086
|
ymax: 11175665.272476234,
|
|
4051
4087
|
spatialReference: 3857,
|
|
4052
4088
|
});
|
|
4053
|
-
|
|
4089
|
+
const targetCenter = myExtent.center;
|
|
4090
|
+
if (this.extentCenter) {
|
|
4091
|
+
const epsilon = 1e-3;
|
|
4092
|
+
const sameStoredCenter =
|
|
4093
|
+
Math.abs(this.extentCenter.x - targetCenter.x) < epsilon &&
|
|
4094
|
+
Math.abs(this.extentCenter.y - targetCenter.y) < epsilon;
|
|
4095
|
+
if (sameStoredCenter) {
|
|
4096
|
+
this.extentInitiated = true;
|
|
4097
|
+
return;
|
|
4098
|
+
}
|
|
4099
|
+
}
|
|
4100
|
+
this.view.goTo({ center: targetCenter, zoom: 3 });
|
|
4101
|
+
this.extentCenter = { x: targetCenter.x, y: targetCenter.y };
|
|
4102
|
+
this.extentInitiated = true;
|
|
4054
4103
|
} else {
|
|
4055
4104
|
this.view.goTo(myExtent);
|
|
4056
4105
|
}
|
|
@@ -4287,8 +4336,10 @@ class MenuWidget extends React.Component {
|
|
|
4287
4336
|
ymax: firstLayer.ymax,
|
|
4288
4337
|
});
|
|
4289
4338
|
if (
|
|
4290
|
-
this.
|
|
4291
|
-
this.layers[elem.id].DatasetId ===
|
|
4339
|
+
this.extentInitiated === false &&
|
|
4340
|
+
(this.layers[elem.id].DatasetId ===
|
|
4341
|
+
'65f8eded11d94a1ba5540ceecaddd4e6' ||
|
|
4342
|
+
this.layers[elem.id].DatasetId === '40e056d02eed4c1fb2040cf0f06823df')
|
|
4292
4343
|
) {
|
|
4293
4344
|
let myExtent = new Extent({
|
|
4294
4345
|
xmin: -13478905.5678019,
|
|
@@ -4297,7 +4348,26 @@ class MenuWidget extends React.Component {
|
|
|
4297
4348
|
ymax: 11175665.272476234,
|
|
4298
4349
|
spatialReference: 3857,
|
|
4299
4350
|
});
|
|
4300
|
-
|
|
4351
|
+
const targetCenter = myExtent.center;
|
|
4352
|
+
if (this.extentCenter) {
|
|
4353
|
+
const epsilon = 1e-3;
|
|
4354
|
+
const sameStoredCenter =
|
|
4355
|
+
Math.abs(this.extentCenter.x - targetCenter.x) < epsilon &&
|
|
4356
|
+
Math.abs(this.extentCenter.y - targetCenter.y) < epsilon;
|
|
4357
|
+
if (sameStoredCenter) {
|
|
4358
|
+
if (this.toggleHotspotWidget.view.zoom !== 3) {
|
|
4359
|
+
this.view.zoom = 3;
|
|
4360
|
+
this.setState({}); // Force re-render
|
|
4361
|
+
return;
|
|
4362
|
+
} else {
|
|
4363
|
+
this.extentInitiated = true;
|
|
4364
|
+
return;
|
|
4365
|
+
}
|
|
4366
|
+
}
|
|
4367
|
+
}
|
|
4368
|
+
this.view.goTo({ center: targetCenter, zoom: 3 });
|
|
4369
|
+
this.extentCenter = { x: targetCenter.x, y: targetCenter.y };
|
|
4370
|
+
this.extentInitiated = true;
|
|
4301
4371
|
} else {
|
|
4302
4372
|
this.view.goTo(myExtent);
|
|
4303
4373
|
}
|
|
@@ -4887,13 +4957,61 @@ class MenuWidget extends React.Component {
|
|
|
4887
4957
|
*/
|
|
4888
4958
|
saveOpacity(layer, value) {
|
|
4889
4959
|
if (this.props.download) return;
|
|
4960
|
+
|
|
4961
|
+
// Resolve layer id from string or layer object
|
|
4962
|
+
let layerId = typeof layer === 'string' ? layer : null;
|
|
4963
|
+
if (!layerId && layer && typeof layer === 'object') {
|
|
4964
|
+
let lid = null;
|
|
4965
|
+
if (layer.id) {
|
|
4966
|
+
lid = layer.id;
|
|
4967
|
+
} else if (layer.LayerId) {
|
|
4968
|
+
lid = layer.LayerId;
|
|
4969
|
+
} else if (layer.layer && layer.layer.id) {
|
|
4970
|
+
lid = layer.layer.id;
|
|
4971
|
+
}
|
|
4972
|
+
layerId = lid;
|
|
4973
|
+
}
|
|
4974
|
+
if (!layerId) return;
|
|
4975
|
+
|
|
4976
|
+
// Update sessionStorage
|
|
4890
4977
|
let layerOpacities = JSON.parse(sessionStorage.getItem('layerOpacities'));
|
|
4891
4978
|
if (layerOpacities === null) {
|
|
4892
4979
|
layerOpacities = {};
|
|
4893
4980
|
}
|
|
4894
|
-
layerOpacities[
|
|
4981
|
+
layerOpacities[layerId] = value;
|
|
4895
4982
|
sessionStorage.setItem('layerOpacities', JSON.stringify(layerOpacities));
|
|
4896
4983
|
|
|
4984
|
+
// Persist basic layer information (metadata + current opacity + visibility)
|
|
4985
|
+
try {
|
|
4986
|
+
let layersInfo = JSON.parse(sessionStorage.getItem('layersInfo'));
|
|
4987
|
+
if (layersInfo === null) layersInfo = {};
|
|
4988
|
+
if (this.layers && this.layers[layerId]) {
|
|
4989
|
+
const l = this.layers[layerId];
|
|
4990
|
+
layersInfo[layerId] = {
|
|
4991
|
+
id: layerId,
|
|
4992
|
+
title: l.title || l.DatasetTitle || l.LayerTitle || '',
|
|
4993
|
+
DatasetId: l.DatasetId || '',
|
|
4994
|
+
ViewService: l.ViewService || l.url || '',
|
|
4995
|
+
type: l.type || '',
|
|
4996
|
+
opacity: value,
|
|
4997
|
+
visible: !!l.visible,
|
|
4998
|
+
};
|
|
4999
|
+
sessionStorage.setItem('layersInfo', JSON.stringify(layersInfo));
|
|
5000
|
+
}
|
|
5001
|
+
} catch (e) {}
|
|
5002
|
+
|
|
5003
|
+
// Mirror into user-specific localStorage blob for persistence across sessions
|
|
5004
|
+
try {
|
|
5005
|
+
const userKey = this.userID ? 'user_' + this.userID : 'user_anonymous';
|
|
5006
|
+
const existing = localStorage.getItem(userKey);
|
|
5007
|
+
const storeObj = existing ? JSON.parse(existing) : {};
|
|
5008
|
+
storeObj['layerOpacities'] = JSON.stringify(layerOpacities);
|
|
5009
|
+
if (sessionStorage.getItem('layersInfo')) {
|
|
5010
|
+
storeObj['layersInfo'] = sessionStorage.getItem('layersInfo');
|
|
5011
|
+
}
|
|
5012
|
+
localStorage.setItem(userKey, JSON.stringify(storeObj));
|
|
5013
|
+
} catch (e) {}
|
|
5014
|
+
|
|
4897
5015
|
// Save to localStorage for user service layers
|
|
4898
5016
|
const savedServices = JSON.parse(
|
|
4899
5017
|
localStorage.getItem(USER_SERVICES_KEY + '_' + this.userID),
|
|
@@ -4904,7 +5022,7 @@ class MenuWidget extends React.Component {
|
|
|
4904
5022
|
|
|
4905
5023
|
// Update opacity for matching layer in user services
|
|
4906
5024
|
savedServices.forEach((service) => {
|
|
4907
|
-
if (service.LayerId ===
|
|
5025
|
+
if (service.LayerId === layerId) {
|
|
4908
5026
|
service.opacity = value;
|
|
4909
5027
|
servicesUpdated = true;
|
|
4910
5028
|
}
|