@eeacms/volto-arcgis-block 0.1.214 → 0.1.215

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,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.215](https://github.com/eea/volto-arcgis-block/compare/0.1.214...0.1.215) - 9 October 2023
8
+
7
9
  ### [0.1.214](https://github.com/eea/volto-arcgis-block/compare/0.1.213...0.1.214) - 5 October 2023
8
10
 
9
11
  ### [0.1.213](https://github.com/eea/volto-arcgis-block/compare/0.1.212...0.1.213) - 4 October 2023
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.214",
3
+ "version": "0.1.215",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -151,33 +151,51 @@ class SwipeWidget extends React.Component {
151
151
  this.swipe.leadingLayers.removeAll();
152
152
  this.swipe.trailingLayers.removeAll();
153
153
  this.swipe.direction = selectedSwipeDirection;
154
+ let vl = JSON.parse(sessionStorage.getItem('visibleLayers'));
154
155
  this.map.layers.forEach((layer) => {
155
156
  layer.visible = false;
156
157
  if (layer.id === selectedLeadingLayer) {
157
158
  layer.visible = true;
159
+ if (vl) {
160
+ for (const key in vl) {
161
+ if (this.layers[key].id === layer.id) {
162
+ if (vl[key][1] === 'eye-slash') {
163
+ layer.visible = false;
164
+ }
165
+ }
166
+ }
167
+ }
158
168
  this.swipe.leadingLayers.add(layer);
159
169
  }
160
170
  if (layer.id === selectedTrailingLayer) {
161
171
  layer.visible = true;
172
+ if (vl) {
173
+ for (const key in vl) {
174
+ if (this.layers[key].id === layer.id) {
175
+ if (vl[key][1] === 'eye-slash') {
176
+ layer.visible = false;
177
+ }
178
+ }
179
+ }
180
+ }
162
181
  this.swipe.trailingLayers.add(layer);
163
182
  }
164
183
  });
165
184
  }
166
185
  loadVisibleLayers() {
167
186
  let vl = JSON.parse(sessionStorage.getItem('visibleLayers'));
168
- if (vl) {
169
- for (const key in vl) {
170
- if (vl[key][1] === 'eye') {
171
- this.layers[key].visible = true;
172
- } else {
173
- this.layers[key].visible = false;
187
+ this.map.layers.forEach((layer) => {
188
+ layer.visible = true;
189
+ if (vl) {
190
+ for (const key in vl) {
191
+ if (this.layers[key].id === layer.id) {
192
+ if (vl[key][1] === 'eye-slash') {
193
+ layer.visible = false;
194
+ }
195
+ }
174
196
  }
175
197
  }
176
- } else {
177
- this.map.layers.forEach((layer) => {
178
- layer.visible = true;
179
- });
180
- }
198
+ });
181
199
  }
182
200
  /**
183
201
  * This method renders the component