@eeacms/volto-arcgis-block 0.1.232 → 0.1.233

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.233](https://github.com/eea/volto-arcgis-block/compare/0.1.232...0.1.233) - 8 November 2023
8
+
7
9
  ### [0.1.232](https://github.com/eea/volto-arcgis-block/compare/0.1.231...0.1.232) - 8 November 2023
8
10
 
9
11
  #### :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.232",
3
+ "version": "0.1.233",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -81,9 +81,15 @@ class SwipeWidget extends React.Component {
81
81
  } else if (change.removed[0]) {
82
82
  if (change.removed[0].DatasetId) {
83
83
  this.loadVisibleLayers();
84
- this.swipe.leadingLayers.removeAll();
85
- this.swipe.trailingLayers.removeAll();
86
- this.props.view.ui.remove(this.swipe);
84
+ if (this.swipe.leadingLayers) {
85
+ this.swipe.leadingLayers.removeAll();
86
+ }
87
+ if (this.swipe.trailingLayers) {
88
+ this.swipe.trailingLayers.removeAll();
89
+ }
90
+ if (this.props.view.ui) {
91
+ this.props.view.ui.remove(this.swipe);
92
+ }
87
93
  }
88
94
  }
89
95
  this.loadOptions();
@@ -120,17 +126,21 @@ class SwipeWidget extends React.Component {
120
126
  }
121
127
  loadOptions() {
122
128
  var selectLeadingLayer = document.getElementById('select-leading-layer');
129
+ if (selectLeadingLayer) {
130
+ this.removeOptions(selectLeadingLayer);
131
+ selectLeadingLayer.options.add(
132
+ new Option('Select a leading layer', 'default', true, true),
133
+ );
134
+ selectLeadingLayer.options[0].disabled = true;
135
+ }
123
136
  var selectTrailingLayer = document.getElementById('select-trailing-layer');
124
- this.removeOptions(selectLeadingLayer);
125
- this.removeOptions(selectTrailingLayer);
126
- selectLeadingLayer.options.add(
127
- new Option('Select a leading layer', 'default', true, true),
128
- );
129
- selectLeadingLayer.options[0].disabled = true;
130
- selectTrailingLayer.options.add(
131
- new Option('Select a trailing layer', 'default', true, true),
132
- );
133
- selectTrailingLayer.options[0].disabled = true;
137
+ if (selectTrailingLayer) {
138
+ this.removeOptions(selectTrailingLayer);
139
+ selectTrailingLayer.options.add(
140
+ new Option('Select a leading layer', 'default', true, true),
141
+ );
142
+ selectTrailingLayer.options[0].disabled = true;
143
+ }
134
144
  let cl = JSON.parse(sessionStorage.getItem('checkedLayers'));
135
145
  this.map.layers.forEach((layer) => {
136
146
  let layerId = layer.id;