@eeacms/volto-arcgis-block 0.1.225 → 0.1.227

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,13 @@ 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.227](https://github.com/eea/volto-arcgis-block/compare/0.1.226...0.1.227) - 30 October 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Update LegendWidget.jsx [Urkorue - [`64b069d`](https://github.com/eea/volto-arcgis-block/commit/64b069d32573befac63e68adf11a328f365595ae)]
12
+ ### [0.1.226](https://github.com/eea/volto-arcgis-block/compare/0.1.225...0.1.226) - 27 October 2023
13
+
7
14
  ### [0.1.225](https://github.com/eea/volto-arcgis-block/compare/0.1.224...0.1.225) - 26 October 2023
8
15
 
9
16
  ### [0.1.224](https://github.com/eea/volto-arcgis-block/compare/0.1.223...0.1.224) - 25 October 2023
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.225",
3
+ "version": "0.1.227",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -122,7 +122,7 @@ class LegendWidget extends React.Component {
122
122
  ].FilterStaticImageLegend;
123
123
  img.parentNode.parentNode.parentNode.parentNode.firstElementChild.textContent =
124
124
  'Protected Areas in Key Landscapes for Conservation borders in selected hot-spots';
125
- } else if (img.style) {
125
+ } /* else if (img.style) {
126
126
  img.parentNode.parentNode.parentNode.parentNode.firstElementChild.style.display =
127
127
  'none';
128
128
  img.style.display = 'none';
@@ -132,12 +132,12 @@ class LegendWidget extends React.Component {
132
132
  let span = document.createElement('span');
133
133
  span.innerHTML = 'No legend available';
134
134
  element.parentNode.appendChild(span);
135
- }
135
+ } */
136
136
  if (
137
- img.closest('.esri-legend__service').firstElementChild.nodeName ===
137
+ img?.closest('.esri-legend__service')?.firstElementChild?.nodeName ===
138
138
  'H3' &&
139
- img.closest('.esri-legend__service').firstElementChild.textContent ===
140
- 'WMS'
139
+ img?.closest('.esri-legend__service')?.firstElementChild
140
+ ?.textContent === 'WMS'
141
141
  ) {
142
142
  img.closest('.esri-legend__service').firstElementChild.style.display =
143
143
  'none';
@@ -229,9 +229,8 @@ class LegendWidget extends React.Component {
229
229
  setTimeout(() => {
230
230
  if (this.props.download) {
231
231
  this.hideNutsLegend();
232
- } else {
233
- this.brokenLegendImagePatch();
234
232
  }
233
+ this.brokenLegendImagePatch();
235
234
  this.setState({ loading: false });
236
235
  }, 2000);
237
236
  }
@@ -338,7 +338,7 @@ class MapViewer extends React.Component {
338
338
  view={this.view}
339
339
  mapViewer={this}
340
340
  map={this.map}
341
- layers={this.layers}
341
+ layers={this.state.layers}
342
342
  />
343
343
  );
344
344
  }
@@ -1899,7 +1899,7 @@ class MenuWidget extends React.Component {
1899
1899
  this.deleteFilteredLayer(elem.id);
1900
1900
  let mapLayer = this.map.findLayerById(elem.id);
1901
1901
  if (mapLayer) {
1902
- mapLayer.clear();
1902
+ if (mapLayer.type && mapLayer.type !== 'base-tile') mapLayer.clear();
1903
1903
  mapLayer.destroy();
1904
1904
  this.map.remove(this.layers[elem.id]);
1905
1905
  }
@@ -2599,7 +2599,9 @@ class MenuWidget extends React.Component {
2599
2599
  firstLayer = BBoxes['all_present_lc_a_pol'];
2600
2600
  } else {
2601
2601
  // Takes the BBOX corresponding to the layer.
2602
- firstLayer = BBoxes[elem.attributes.layerid.value];
2602
+ if (this.productId.includes('333e4100b79045daa0ff16466ac83b7f')) {
2603
+ firstLayer = BBoxes[0];
2604
+ } else firstLayer = BBoxes[elem.attributes.layerid.value];
2603
2605
  }
2604
2606
 
2605
2607
  let myExtent = new Extent({
@@ -121,12 +121,69 @@ class SwipeWidget extends React.Component {
121
121
  );
122
122
  selectTrailingLayer.options[0].disabled = true;
123
123
  this.map.layers.forEach((layer) => {
124
- selectLeadingLayer.options.add(
125
- new Option(this.getLayerTitle(layer), layer.id, layer.id),
126
- );
127
- selectTrailingLayer.options.add(
128
- new Option(this.getLayerTitle(layer), layer.id, layer.id),
129
- );
124
+ let layerId = layer.id;
125
+ if (this.layers['lcc_filter']) {
126
+ if (
127
+ layer.id === this.layers['all_lcc_a_pol_1_4_1_0'].id ||
128
+ layer.id === this.layers['all_lcc_b_pol_1_4_1_1'].id
129
+ ) {
130
+ layerId = this.layers['lcc_filter'].id;
131
+ }
132
+ if (layer.id !== this.layers['lcc_filter'].id) {
133
+ selectLeadingLayer.options.add(
134
+ new Option(this.getLayerTitle(layer), layerId, layerId),
135
+ );
136
+ selectTrailingLayer.options.add(
137
+ new Option(this.getLayerTitle(layer), layerId, layerId),
138
+ );
139
+ }
140
+ } else if (this.layers['lc_filter']) {
141
+ if (
142
+ layer.id === this.layers['all_present_lc_a_pol_1_4_0_0'].id ||
143
+ layer.id === this.layers['all_present_lc_b_pol_1_4_0_1'].id
144
+ ) {
145
+ layerId = this.layers['lc_filter'].id;
146
+ }
147
+ if (layer.id !== this.layers['lc_filter'].id) {
148
+ selectLeadingLayer.options.add(
149
+ new Option(this.getLayerTitle(layer), layerId, layerId),
150
+ );
151
+ selectTrailingLayer.options.add(
152
+ new Option(this.getLayerTitle(layer), layerId, layerId),
153
+ );
154
+ }
155
+ } else if (this.layers['klc_filter']) {
156
+ if (layer.id === this.layers['cop_klc_1_4_2_0'].id) {
157
+ layerId = this.layers['klc_filter'].id;
158
+ }
159
+ if (layer.id !== this.layers['klc_filter'].id) {
160
+ selectLeadingLayer.options.add(
161
+ new Option(this.getLayerTitle(layer), layerId, layerId),
162
+ );
163
+ selectTrailingLayer.options.add(
164
+ new Option(this.getLayerTitle(layer), layerId, layerId),
165
+ );
166
+ }
167
+ } else if (this.layers['pa_filter']) {
168
+ if (layer.id === this.layers['protected_areas_1_4_3_0'].id) {
169
+ layerId = this.layers['pa_filter'].id;
170
+ }
171
+ if (layer.id !== this.layers['pa_filter'].id) {
172
+ selectLeadingLayer.options.add(
173
+ new Option(this.getLayerTitle(layer), layerId, layerId),
174
+ );
175
+ selectTrailingLayer.options.add(
176
+ new Option(this.getLayerTitle(layer), layerId, layerId),
177
+ );
178
+ }
179
+ } else {
180
+ selectLeadingLayer.options.add(
181
+ new Option(this.getLayerTitle(layer), layerId, layerId),
182
+ );
183
+ selectTrailingLayer.options.add(
184
+ new Option(this.getLayerTitle(layer), layerId, layerId),
185
+ );
186
+ }
130
187
  });
131
188
  }
132
189
  removeOptions(selectElement) {
@@ -185,7 +242,39 @@ class SwipeWidget extends React.Component {
185
242
  loadVisibleLayers() {
186
243
  let vl = JSON.parse(sessionStorage.getItem('visibleLayers'));
187
244
  this.map.layers.forEach((layer) => {
188
- layer.visible = true;
245
+ if (this.layers['lcc_filter']) {
246
+ if (
247
+ layer.id === this.layers['all_lcc_a_pol_1_4_1_0'].id ||
248
+ layer.id === this.layers['all_lcc_b_pol_1_4_1_1'].id
249
+ ) {
250
+ layer.visible = false;
251
+ } else {
252
+ layer.visible = true;
253
+ }
254
+ } else if (this.layers['lc_filter']) {
255
+ if (
256
+ layer.id === this.layers['all_present_lc_a_pol_1_4_0_0'].id ||
257
+ layer.id === this.layers['all_present_lc_b_pol_1_4_0_1'].id
258
+ ) {
259
+ layer.visible = false;
260
+ } else {
261
+ layer.visible = true;
262
+ }
263
+ } else if (this.layers['klc_filter']) {
264
+ if (layer.id === this.layers['cop_klc_1_4_2_0'].id) {
265
+ layer.visible = false;
266
+ } else {
267
+ layer.visible = true;
268
+ }
269
+ } else if (this.layers['pa_filter']) {
270
+ if (layer.id === this.layers['protected_areas_1_4_3_0'].id) {
271
+ layer.visible = false;
272
+ } else {
273
+ layer.visible = true;
274
+ }
275
+ } else {
276
+ layer.visible = true;
277
+ }
189
278
  if (vl) {
190
279
  for (const key in vl) {
191
280
  if (this.layers[key].id === layer.id) {