@eeacms/volto-arcgis-block 0.1.6 → 0.1.10

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,8 +4,57 @@ 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.10](https://github.com/eea/volto-arcgis-block/compare/0.1.9...0.1.10)
8
+
9
+ - Update use-cases default center and zoom [`#26`](https://github.com/eea/volto-arcgis-block/pull/26)
10
+ - Popup bug fix [`#25`](https://github.com/eea/volto-arcgis-block/pull/25)
11
+
12
+ #### [0.1.9](https://github.com/eea/volto-arcgis-block/compare/0.1.8...0.1.9)
13
+
14
+ > 14 October 2021
15
+
16
+ - New features for use-cases [`#24`](https://github.com/eea/volto-arcgis-block/pull/24)
17
+ - Added new level when point has multiple use cases and minor improvements [`#23`](https://github.com/eea/volto-arcgis-block/pull/23)
18
+ - Remove a debugger; [`1bda983`](https://github.com/eea/volto-arcgis-block/commit/1bda983bd6c5db9787c1f28b3e86a5b8e4114c5c)
19
+ - Added new level when point has multiple use cases [`a994fb4`](https://github.com/eea/volto-arcgis-block/commit/a994fb41f9f80e3de3f2806de4e491dc0b503f80)
20
+ - Use cases list height [`546cab7`](https://github.com/eea/volto-arcgis-block/commit/546cab76b790ac037b7e17858bbdea499eb1cb05)
21
+ - Solved mapViewer back and cross buttons [`0591a2c`](https://github.com/eea/volto-arcgis-block/commit/0591a2c9887a5b117343fc407cdae9a0fb91b123)
22
+ - Removed extra UK counter [`b4dc926`](https://github.com/eea/volto-arcgis-block/commit/b4dc926e909ad3b52d93a062d839e0066854460e)
23
+ - Check if only one use case is on a region [`09cce4e`](https://github.com/eea/volto-arcgis-block/commit/09cce4ea6f9619cfb88ef0046818d8267d1aed6c)
24
+ - Use case detail link [`365d5b3`](https://github.com/eea/volto-arcgis-block/commit/365d5b3c0e8aaefa0207b47181e4eed20c60bf24)
25
+
26
+ #### [0.1.8](https://github.com/eea/volto-arcgis-block/compare/0.1.7...0.1.8)
27
+
28
+ > 14 October 2021
29
+
30
+ - Active by default v2 [`#22`](https://github.com/eea/volto-arcgis-block/pull/22)
31
+ - version2 working [`#21`](https://github.com/eea/volto-arcgis-block/pull/21)
32
+
33
+ #### [0.1.7](https://github.com/eea/volto-arcgis-block/compare/0.1.6...0.1.7)
34
+
35
+ > 13 October 2021
36
+
37
+ - Develop [`#18`](https://github.com/eea/volto-arcgis-block/pull/18)
38
+ - Bugs n improvements [`#17`](https://github.com/eea/volto-arcgis-block/pull/17)
39
+ - Merge pull request #20 from eea/bugs_n_improvements [`c59b800`](https://github.com/eea/volto-arcgis-block/commit/c59b800832a7d566585f9fd4b8a9208f566bd4da)
40
+ - Merge pull request #19 from eea/active_by_default [`1737a36`](https://github.com/eea/volto-arcgis-block/commit/1737a3655ec94f0e6fd5e6900fdfb5ad0208e9c0)
41
+ - eslint fixed [`df9dad5`](https://github.com/eea/volto-arcgis-block/commit/df9dad54d9dd658468deeaa5cf85945721d08ff1)
42
+ - Print bug [`7644990`](https://github.com/eea/volto-arcgis-block/commit/7644990717c0192d4fb78f0cca411682af44833b)
43
+ - version working [`fe5eb7c`](https://github.com/eea/volto-arcgis-block/commit/fe5eb7cdab05b85dabdd055c88133221e30208f5)
44
+ - Print bug [`6ec6434`](https://github.com/eea/volto-arcgis-block/commit/6ec643442c6420841c97ca3b3db3338e7a825182)
45
+ - toggleProduct [`948d750`](https://github.com/eea/volto-arcgis-block/commit/948d750e67ffff893254f855ac4671ff82ce2f86)
46
+ - Print bug [`5590343`](https://github.com/eea/volto-arcgis-block/commit/5590343e061f28cbf4e7718d32a0e135c16e397f)
47
+ - Print bug [`daafb78`](https://github.com/eea/volto-arcgis-block/commit/daafb787aa025a39dd940087f84d4255e603fc9c)
48
+ - arrays for checkbox ok [`48b34cb`](https://github.com/eea/volto-arcgis-block/commit/48b34cba5ac6f1b1bb309386c7e6e1ea197b52d7)
49
+ - fixed array dataset in products [`7c42783`](https://github.com/eea/volto-arcgis-block/commit/7c427835794c31530ea0f878319ee19d5b4dd5fc)
50
+ - arrays to define check default [`88cbdbc`](https://github.com/eea/volto-arcgis-block/commit/88cbdbc23d524694a390d8646355795b1ad327b4)
51
+ - Change config.js for test [`efb0c21`](https://github.com/eea/volto-arcgis-block/commit/efb0c21cdbc0028076348f5484e329a1fec59b4a)
52
+
7
53
  #### [0.1.6](https://github.com/eea/volto-arcgis-block/compare/0.1.5...0.1.6)
8
54
 
55
+ > 8 October 2021
56
+
57
+ - Use cases map [`#16`](https://github.com/eea/volto-arcgis-block/pull/16)
9
58
  - Configured zoom out label and added to config file and set color for point-markers [`#15`](https://github.com/eea/volto-arcgis-block/pull/15)
10
59
  - Remove unused variables [`f4833ee`](https://github.com/eea/volto-arcgis-block/commit/f4833ee95782fdf0252db333eb5c8a1eb1d3cbe6)
11
60
  - Configured zoom out label and added to config file [`34b1ec6`](https://github.com/eea/volto-arcgis-block/commit/34b1ec67d9eca169652f1709f018bf03edea7a97)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.6",
3
+ "version": "0.1.10",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -1,6 +1,7 @@
1
1
  import React, { createRef } from 'react';
2
2
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3
3
  import { loadModules, loadCss } from 'esri-loader';
4
+ // import { layer } from '@fortawesome/fontawesome-svg-core';
4
5
  var WMSLayer;
5
6
 
6
7
  class MenuWidget extends React.Component {
@@ -138,11 +139,19 @@ class MenuWidget extends React.Component {
138
139
  * @returns
139
140
  */
140
141
  metodProcessProduct(product, prodIndex, inheritedIndex) {
142
+ var dataset_def = [];
141
143
  var datasets = [];
142
144
  var index = 0;
143
145
  var inheritedIndexProduct = inheritedIndex + '_' + prodIndex;
144
146
  var checkProduct = 'map_product_' + inheritedIndexProduct;
147
+
148
+ //Add only default datasets
145
149
  for (var i in product.Datasets) {
150
+ if (product.Datasets[i].Default_active === true) {
151
+ var idDataset = 'map_dataset_' + inheritedIndexProduct + '_' + index;
152
+ dataset_def.push(idDataset);
153
+ }
154
+
146
155
  datasets.push(
147
156
  this.metodProcessDataset(
148
157
  product.Datasets[i],
@@ -154,6 +163,12 @@ class MenuWidget extends React.Component {
154
163
  index++;
155
164
  }
156
165
 
166
+ // Empty vector, add the first dataset
167
+ if (!dataset_def.length) {
168
+ var idDatasetB = 'map_dataset_' + inheritedIndexProduct + '_0';
169
+ dataset_def.push(idDatasetB);
170
+ }
171
+
157
172
  return (
158
173
  <div
159
174
  className="map-menu-product-dropdown"
@@ -182,8 +197,9 @@ class MenuWidget extends React.Component {
182
197
  value="name"
183
198
  className="ccl-checkbox ccl-required ccl-form-check-input"
184
199
  key={'h' + prodIndex}
200
+ defcheck={dataset_def}
185
201
  onChange={(e) =>
186
- this.toggleProduct(e.target.checked, checkProduct)
202
+ this.toggleProduct(e.target.checked, checkProduct, e)
187
203
  }
188
204
  ></input>
189
205
  <label
@@ -219,7 +235,8 @@ class MenuWidget extends React.Component {
219
235
  );
220
236
  let productCheck = document.querySelector('#' + productid);
221
237
  let trueCheck = datasetChecks.filter((elem) => elem.checked).length;
222
- productCheck.checked = datasetChecks.length === trueCheck;
238
+
239
+ productCheck.checked = trueCheck > 0;
223
240
  }
224
241
 
225
242
  /**
@@ -231,12 +248,17 @@ class MenuWidget extends React.Component {
231
248
  * @returns
232
249
  */
233
250
  metodProcessDataset(dataset, datIndex, inheritedIndex, checkProduct) {
251
+ var layer_default = [];
234
252
  var layers = [];
235
253
  var index = 0;
236
254
  var inheritedIndexDataset = inheritedIndex + '_' + datIndex;
237
255
  var checkIndex = 'map_dataset_' + inheritedIndexDataset;
238
256
 
239
257
  for (var i in dataset.Layer) {
258
+ if (dataset.Layer[i].Default_active === true) {
259
+ layer_default.push(dataset.Layer[i].LayerId);
260
+ }
261
+
240
262
  layers.push(
241
263
  this.metodProcessLayer(
242
264
  dataset.Layer[i],
@@ -244,11 +266,15 @@ class MenuWidget extends React.Component {
244
266
  inheritedIndexDataset,
245
267
  dataset.ViewService,
246
268
  checkIndex,
269
+ layer_default,
247
270
  ),
248
271
  );
249
272
  index++;
250
273
  }
251
274
 
275
+ if (!layer_default.length) {
276
+ layer_default.push(dataset.Layer[0].LayerId);
277
+ }
252
278
  // ./dataset-catalogue/dataset-info.html
253
279
  // ./dataset-catalogue/dataset-download.html
254
280
 
@@ -265,10 +291,11 @@ class MenuWidget extends React.Component {
265
291
  parentid={checkProduct}
266
292
  name=""
267
293
  value="name"
294
+ defcheck={layer_default}
268
295
  className="ccl-checkbox ccl-required ccl-form-check-input"
269
296
  key={'c' + datIndex}
270
297
  onChange={(e) => {
271
- this.toggleDataset(e.target.checked, checkIndex);
298
+ this.toggleDataset(e.target.checked, checkIndex, e.target);
272
299
  }}
273
300
  ></input>
274
301
  <label
@@ -305,7 +332,7 @@ class MenuWidget extends React.Component {
305
332
 
306
333
  /**
307
334
  * Method to uncheck dataset checkbox if not all layers are checked
308
- * @param {*} id
335
+ * @param {*} id parentId (id del dataset)
309
336
  */
310
337
 
311
338
  updateCheckDataset(id) {
@@ -313,8 +340,11 @@ class MenuWidget extends React.Component {
313
340
  let layerChecks = Array.from(
314
341
  document.querySelectorAll('[parentid=' + id + ']'),
315
342
  );
343
+
316
344
  let trueChecks = layerChecks.filter((elem) => elem.checked).length;
317
- datasetCheck.checked = layerChecks.length === trueChecks;
345
+ //solo tiene que tener alguno length >0
346
+ datasetCheck.checked = trueChecks > 0;
347
+
318
348
  this.updateCheckProduct(datasetCheck.getAttribute('parentid'));
319
349
  }
320
350
 
@@ -432,9 +462,20 @@ class MenuWidget extends React.Component {
432
462
  * Method to show/hide all the layers of a dataset
433
463
  * @param {*} value
434
464
  * @param {*} id
465
+ * @param {*} element
435
466
  */
436
- toggleDataset(value, id) {
437
- var layerChecks = document.querySelectorAll('[parentid=' + id + ']');
467
+ toggleDataset(value, id, e) {
468
+ var layerdef = e.getAttribute('defcheck');
469
+ var splitdefCheck = layerdef.split(',');
470
+
471
+ var layerChecks = [];
472
+ var selector = [];
473
+
474
+ for (var i = 0; i < splitdefCheck.length; i++) {
475
+ selector = document.querySelector('[id="' + splitdefCheck[i] + '"]');
476
+ layerChecks.push(selector);
477
+ }
478
+
438
479
  layerChecks.forEach((element) => {
439
480
  element.checked = value;
440
481
  this.toggleLayer(element);
@@ -443,14 +484,24 @@ class MenuWidget extends React.Component {
443
484
 
444
485
  /**
445
486
  * Method to show/hide all the datasets of a product
446
- * @param {*} value
487
+ * @param {*} value (e.target.checked)
447
488
  * @param {*} id
489
+ * @param {*} element (checkbox)
448
490
  */
449
- toggleProduct(value, id) {
450
- var datasetChecks = document.querySelectorAll('[parentid=' + id + ']');
491
+ toggleProduct(value, id, element) {
492
+ var productDefCheck = element.target.getAttribute('defcheck');
493
+ var splitdefCheck = productDefCheck.split(',');
494
+
495
+ var datasetChecks = [];
496
+ var selector = [];
497
+
498
+ for (var i = 0; i < splitdefCheck.length; i++) {
499
+ selector = document.querySelector('[id=' + splitdefCheck[i] + ']');
500
+ datasetChecks.push(selector);
501
+ }
451
502
  datasetChecks.forEach((element) => {
452
503
  element.checked = value;
453
- this.toggleDataset(value, element.id);
504
+ this.toggleDataset(value, element.id, element);
454
505
  });
455
506
  }
456
507
 
@@ -21,7 +21,7 @@ class PrintWidget extends React.Component {
21
21
  this.titleMaxLength = 50;
22
22
  this.authorMaxLength = 60;
23
23
  this.textMaxLength = 180;
24
- this.sizeMax = 6000;
24
+ this.sizeMax = 15000;
25
25
  this.dpiMax = 1200;
26
26
  this.scaleMax = 600000000;
27
27
  }
@@ -90,6 +90,10 @@ class PrintWidget extends React.Component {
90
90
  this.setTextFilters();
91
91
  let optSVGZ = document.querySelector("[value='svgz']");
92
92
  optSVGZ && optSVGZ.parentElement.removeChild(optSVGZ);
93
+ let advanceOptions = document.querySelector(
94
+ '.esri-print__advanced-options-button',
95
+ );
96
+ observer2.observe(advanceOptions, { attributes: true });
93
97
  } else {
94
98
  this.setLayoutConstraints();
95
99
  }
@@ -97,6 +101,19 @@ class PrintWidget extends React.Component {
97
101
  });
98
102
  });
99
103
  observer.observe(mapOnly, { attributes: true });
104
+
105
+ var observer2 = new MutationObserver((mutations) => {
106
+ mutations.forEach((mutation) => {
107
+ if (mutation.attributeName === 'aria-expanded') {
108
+ let currentExpand = mutation.target.getAttribute('aria-expanded');
109
+ if (currentExpand === 'true') {
110
+ this.setTextFilters();
111
+ } else {
112
+ this.setLayoutConstraints();
113
+ }
114
+ }
115
+ });
116
+ });
100
117
  }
101
118
 
102
119
  setLayoutConstraints() {
@@ -135,14 +152,23 @@ class PrintWidget extends React.Component {
135
152
  elem.setSelectionRange(c, c);
136
153
  }
137
154
 
138
- imposeMax(el) {
139
- if (el.value !== '') {
140
- if (parseInt(el.value) < parseInt(el.min)) {
141
- el.value = el.min;
155
+ imposeMax(elem) {
156
+ if (elem.value !== '') {
157
+ if (parseInt(elem.value) < parseInt(elem.min)) {
158
+ elem.value = elem.min;
142
159
  }
143
- if (parseInt(el.value) > parseInt(el.max)) {
144
- el.value = el.max;
160
+ if (parseInt(elem.value) > parseInt(elem.max)) {
161
+ elem.value = elem.max;
145
162
  }
163
+ } else {
164
+ elem.value = elem.value.replace(/[^e+-,.]/gi, '');
165
+ }
166
+ }
167
+
168
+ noSpecialNumbs(e) {
169
+ var invalidChars = ['-', '+', 'e', ',', '.'];
170
+ if (invalidChars.includes(e.key)) {
171
+ e.preventDefault();
146
172
  }
147
173
  }
148
174
 
@@ -177,6 +203,9 @@ class PrintWidget extends React.Component {
177
203
  input.oninput = () => {
178
204
  this.imposeMax(input);
179
205
  };
206
+ input.onkeydown = (e) => {
207
+ this.noSpecialNumbs(e);
208
+ };
180
209
  }
181
210
  });
182
211
  }
@@ -22,14 +22,17 @@ const config = {
22
22
  'The Coastal Zones (CZ) LC/LU product for 2012 is providing a detailed Land Cover / Land Use (LC/ LU) dataset for areas along the coastline of the EEA38 countries and the United Kingdom, with reference year 2012 for the classification. This product monitors landscape dynamics in European coastal territory to an inland depth of 10 km with a total area of approximately 730,000 km², with all the relevant areas (estuaries, coastal lowlands, nature reserves). The production of the coastal zone layers was coordinated by the European Environment Agency (EEA) in the frame of the EU Copernicus programme, as part of the Copernicus Land Monitoring Service (CLMS) Local Component.The Coastal Zones product covers a buffer zone of coastline derived from EU-Hydro v1.1. Land Cover/Land Use (LC/LU) layer is extracted from Very High Resolution (VHR) satellite data and other available data. The class definitions follow the pre-defined nomenclature on the basis of Mapping and Assessment of Ecosystems and their Services (MAES) typology of ecosystems (Level 1 to Level 4) and CORINE Land Cover adapted to the specific characteristics of coastal zones. The classification provides 71 distinct thematic classes with a Minimum Mapping Unit (MMU) of 0.5 ha and a Minimum Mapping Width (MMW) of 10 m. The product is available for the 2012 and 2018 reference year including change mapping.This CZ dataset is distributed in vector format, in a single OGC GeoPackage SQLite file covering the area of interest.',
23
23
  ViewService:
24
24
  'https://image.discomap.eea.europa.eu/arcgis/services/CoastalZones/CZ_CoastalZones_2012/MapServer/WmsServer?',
25
+ Default_active: true,
25
26
  Layer: [
26
27
  {
27
28
  LayerId: 'Coastal_Zones_2012_vector53031',
28
29
  Title: 'Coastal Zones 2012 vector',
30
+ Default_active: false,
29
31
  },
30
32
  {
31
33
  LayerId: 'Coastal_Zones_2012_raster55645',
32
34
  Title: 'Coastal Zones 2012 raster',
35
+ Default_active: false,
33
36
  },
34
37
  ],
35
38
  DownloadService: 'EEA',
@@ -44,14 +47,17 @@ const config = {
44
47
  'The Coastal Zones (CZ) LC/LU product for 2018 is providing a detailed Land Cover / Land Use (LC/ LU) dataset for areas along the coastline of the EEA38 countries and the United Kingdom, with reference year 2018 for the classification. This product monitors landscape dynamics in European coastal territory to an inland depth of 10 km with a total area of approximately 730,000 km², with all the relevant areas (estuaries, coastal lowlands, nature reserves). The production of the coastal zone layers was coordinated by the European Environment Agency (EEA) in the frame of the EU Copernicus programme, as part of the Copernicus Land Monitoring Service (CLMS) Local Component. The Coastal Zones product covers a buffer zone of coastline derived from EU-Hydro v1.1. Land Cover/Land Use (LC/LU) layer is extracted from Very High Resolution (VHR) satellite data and other available data. The class definitions follow the pre-defined nomenclature on the basis of Mapping and Assessment of Ecosystems and their Services (MAES) typology of ecosystems (Level 1 to Level 4) and CORINE Land Cover adapted to the specific characteristics of coastal zones. The classification provides 71 distinct thematic classes with a Minimum Mapping Unit (MMU) of 0.5 ha and a Minimum Mapping Width (MMW) of 10 m. The product is available for the 2012 and 2018 reference year including change mapping. This CZ dataset is distributed in vector format, in a single OGC GeoPackage SQLite file covering the area of interest.',
45
48
  ViewService:
46
49
  'https://image.discomap.eea.europa.eu/arcgis/services/CoastalZones/CZ_CoastalZones_2018/MapServer/WmsServer?',
50
+ Default_active: true,
47
51
  Layer: [
48
52
  {
49
53
  LayerId: 'Coastal_Zones_2018_vector57533',
50
54
  Title: 'Coastal Zones 2018 vector',
55
+ Default_active: false,
51
56
  },
52
57
  {
53
58
  LayerId: 'Coastal_Zones_2018_raster65095',
54
59
  Title: 'Coastal Zones 2018 raster',
60
+ Default_active: true,
55
61
  },
56
62
  ],
57
63
  DownloadService: 'EEA',
@@ -67,14 +73,17 @@ const config = {
67
73
  'The Coastal Zones LC/LU Change (CZC) 2012-2018 is providing the Land Cover / Land Use (LC/ LU) change for areas along the coastline of the EEA38 countries and the United Kingdom, between the reference years 2012 and 2018. The Coastal Zones product monitors landscape dynamics in European coastal territory to an inland depth of 10 km with a total area of approximately 730,000 km², with all the relevant areas (estuaries, coastal lowlands, nature reserves). The production of the coastal zone layers was coordinated by the European Environment Agency (EEA) in the frame of the EU Copernicus programme, as part of the Copernicus Land Monitoring Service (CLMS) Local Component. The Coastal Zones Change product covers a buffer zone of coastline derived from EU-Hydro v1.1. The Land Cover/Land Use (LC/LU) Change layer is extracted from Very High Resolution (VHR) satellite data and other available data. The reference years for the change are 2012 and 2018. The class definitions follow the pre-defined nomenclature on the basis of Mapping and Assessment of Ecosystems and their Services (MAES) typology of ecosystems (Level 1 to Level 4) and CORINE Land Cover adapted to the specific characteristics of coastal zones. The classification provides 71 distinct thematic classes with a Minimum Mapping Unit (MMU) of 0.5 ha and a Minimum Mapping Width (MMW) of 10 m. The status product is available for the 2012 and 2018 reference years. This CZC dataset is distributed in vector format, in a single OGC GeoPackage file covering the area of interest.',
68
74
  ViewService:
69
75
  'https://image.discomap.eea.europa.eu/arcgis/services/CoastalZones/CZ_CoastalZonesChange_2012_2018/MapServer/WmsServer?',
76
+ Default_active: false,
70
77
  Layer: [
71
78
  {
72
79
  LayerId: 'Coastal_Zones_Change_2012-2018_vector17215',
73
80
  Title: 'Coastal Zones Change 2012-2018 vector',
81
+ Default_active: false,
74
82
  },
75
83
  {
76
84
  LayerId: 'Coastal_Zones_Change_2012-2018_raster20357',
77
85
  Title: 'Coastal Zones Change 2012-2018 raster',
86
+ Default_active: false,
78
87
  },
79
88
  ],
80
89
  DownloadService: 'EEA',
@@ -100,34 +109,42 @@ const config = {
100
109
  DatasetDescription:
101
110
  'The Copernicus Fractional Snow Cover (FSC) product is generated in near real-time for the entire EEA38 and the United Kingdom, based on optical satellite data from the Sentinel-2 constellation (revisit time: 5 days with Sentinel-2A and Sentinel-2B). The product provides the fraction of the surface covered by snow at the top of canopy (FSC-TOC) and on ground (FSC-OG) per pixel as a percentage (0% – 100%) with a spatial resolution of 20 m x 20 m. The FSC is one of the products of the pan-European High-Resolution Snow & Ice service (HR-S&I), which are provided at high spatial resolution (20 m x 20 m), and are derived from the Sentinel-2 constellation data. They are generated over the entire EEA38 (32 member countries and 6 cooperating countries) and the United Kingdom, from September 1, 2016 onwards. Four types of HR-S&I products are proposed to users: the Fractional Snow Cover (FSC) product, the Persistent Snow Area (PSA) product, the River and Lake Ice Extent (RLIE) product and the Aggregated River and Lake Ice Extent (ARLIE) product. The FSC product is distributed in raster files covering an area of 110 km by 110 km with a pixel size of 20 m by 20 m in UTM/WGS84 projection, which corresponds to the Sentinel-2 input L1C product tile. Each product is composed of seven separate files corresponding to the different layers of the product, and another metadata file.',
102
111
  ViewService: 'https://cryo.land.copernicus.eu/wms/FSC/?',
112
+ Default_active: true,
103
113
  Layer: [
104
114
  {
105
115
  LayerId: '1_FSC_TOC',
106
116
  Title: 'FSC_TOC',
117
+ Default_active: true,
107
118
  },
108
119
  {
109
120
  LayerId: '2_FSC_QC_TOC',
110
121
  Title: 'FSC_QC_TOC',
122
+ Default_active: true,
111
123
  },
112
124
  {
113
125
  LayerId: '3_FSC_OG',
114
126
  Title: 'FSC_OG',
127
+ Default_active: false,
115
128
  },
116
129
  {
117
130
  LayerId: '4_FSC_QC_OG',
118
131
  Title: 'FSC_QC_OG',
132
+ Default_active: false,
119
133
  },
120
134
  {
121
135
  LayerId: '5_FSC_NDSI',
122
136
  Title: 'FSC_NDSI',
137
+ Default_active: false,
123
138
  },
124
139
  {
125
140
  LayerId: '6_FSC_CLD',
126
141
  Title: 'FSC_CLD',
142
+ Default_active: false,
127
143
  },
128
144
  {
129
145
  LayerId: '7_FSC_QC_FLAGS',
130
146
  Title: 'FSC_QC_FLAGS',
147
+ Default_active: false,
131
148
  },
132
149
  ],
133
150
  DownloadService: 'WEKEO',
@@ -143,18 +160,22 @@ const config = {
143
160
  DatasetDescription:
144
161
  'The Copernicus River and Lake Ice Extent (RLIE) product is generated in near real-time for the entire EEA38 and the United Kingdom based on optical satellite data from the Sentinel-2 constellation (revisit time: 5 days with Sentinel-2A and Sentinel-2B). The product provides the river and lake area covered by snow-covered or snow-free ice with a spatial resolution of 20 m x 20 m. The RLIE is one of the products of the pan-European High-Resolution Snow & Ice service (HR-S&I), which are provided at high spatial resolution (20 m x 20 m), and are derived from the Sentinel-2 constellation data. They are generated over the entire EEA38 (32 member countries and 6 cooperating countries) and the United Kingdom, from September 1, 2016 onwards. Four types of HR-S&I products are proposed to users: the Fractional Snow Cover (FSC) product, the Persistent Snow Area (PSA) product, the River and Lake Ice Extent (RLIE) product and the Aggregated River and Lake Ice Extent (ARLIE) product. Each RLIE product covers an area of 110 km x 110 km with a pixel size of 20 m x 20 m in UTM/WGS84, aligned with the Sentinel-2 input L1C product, over the entire EEA38 and the United Kingdom area and within the EU-Hydro polygon features. Each RLIE product is composed of three separate files corresponding to the different layers of the product, and a metadata file.',
145
162
  ViewService: 'https://cryo.land.copernicus.eu/wms/RLIE/?',
163
+ Default_active: false,
146
164
  Layer: [
147
165
  {
148
166
  LayerId: '1_RLIE',
149
167
  Title: 'RLIE',
168
+ Default_active: true,
150
169
  },
151
170
  {
152
171
  LayerId: '2_RLIE_QC',
153
172
  Title: 'RLIE_QC',
173
+ Default_active: false,
154
174
  },
155
175
  {
156
176
  LayerId: '3_RLIE_QC_FLAGS',
157
177
  Title: 'RLIE_QC_FLAGS',
178
+ Default_active: false,
158
179
  },
159
180
  ],
160
181
  DownloadService: 'WEKEO',
@@ -17,7 +17,7 @@
17
17
  position: absolute;
18
18
  top: 50%;
19
19
  left: 50%;
20
- color: #273b4b;
20
+ color: #212529;
21
21
  font-size: 2rem;
22
22
  touch-action: auto;
23
23
  }
@@ -33,6 +33,10 @@
33
33
  outline: none;
34
34
  }
35
35
 
36
+ .esri-view-height-less-than-medium .esri-popup__main-container {
37
+ max-height: 250px !important;
38
+ }
39
+
36
40
  .esri-component.esri-zoom.esri-widget {
37
41
  margin-bottom: 0;
38
42
  background: none;
@@ -169,6 +173,17 @@
169
173
  vertical-align: middle;
170
174
  }
171
175
 
176
+ .print-container .esri-print .esri-print__swap-button,
177
+ .print-container .esri-print .esri-print__refresh-button {
178
+ color: #dadada;
179
+ }
180
+
181
+ .print-container .esri-print .esri-print__swap-button:hover,
182
+ .print-container .esri-print .esri-print__refresh-button:hover {
183
+ background: none;
184
+ color: #212529;
185
+ }
186
+
172
187
  /* Area */
173
188
  .area-container {
174
189
  display: flex;
@@ -3,18 +3,14 @@ import React, { createRef } from 'react';
3
3
  let layerControl,
4
4
  navigationControl,
5
5
  view,
6
+ mapViewer,
6
7
  layerSpatial,
7
8
  processedData = [];
8
9
  class InfoWidget extends React.Component {
9
10
  constructor(props) {
10
11
  super(props);
11
12
  view = props.view;
12
- this.state = {
13
- useCaseLevel: 1,
14
- region: '',
15
- selectedUseCase: '',
16
- previousState: 1,
17
- };
13
+ mapViewer = props.mapViewer;
18
14
  navigationControl = props.navigationControl;
19
15
  layerControl = props.layerControl;
20
16
  layerSpatial = props.layerSpatial;
@@ -37,7 +33,7 @@ class InfoWidget extends React.Component {
37
33
  aria-label="Close"
38
34
  aria-hidden="true"
39
35
  role="button"
40
- onClick={() => navigationControl.returnToPrevious(this)}
36
+ onClick={() => navigationControl.returnToPrevious()}
41
37
  ></span>
42
38
  </div>
43
39
  <div className="use-case-detail-image">
@@ -62,10 +58,12 @@ class InfoWidget extends React.Component {
62
58
  </div>
63
59
  <div className="use-case-detail-description">
64
60
  <p>{UseCase.Use_case_summary}</p>
65
- <p>
66
- For further information{' '}
67
- <a href={UseCase.Links_to_web_sites}>here</a>.
68
- </p>
61
+ {UseCase.Links_to_web_sites && (
62
+ <p>
63
+ For further information{' '}
64
+ <a href={UseCase.Links_to_web_sites}>here</a>.
65
+ </p>
66
+ )}
69
67
  </div>
70
68
  </div>
71
69
  </div>
@@ -87,8 +85,8 @@ class InfoWidget extends React.Component {
87
85
  className="use-case-element"
88
86
  aria-hidden="true"
89
87
  onClick={() =>
90
- this.setState((prevState) => ({
91
- useCaseLevel: 3,
88
+ mapViewer.setState((prevState) => ({
89
+ useCaseLevel: 4,
92
90
  selectedUseCase: val,
93
91
  previousState: prevState.useCaseLevel,
94
92
  }))
@@ -116,35 +114,67 @@ class InfoWidget extends React.Component {
116
114
  */
117
115
  showBrief(selectedRegion) {
118
116
  const regionFeatures = [];
119
-
120
- for (let feature in this.features) {
121
- if (this.features[feature].attributes.Region === selectedRegion) {
122
- regionFeatures.push(this.features[feature].attributes);
117
+ if (mapViewer.state.useCaseLevel === 2) {
118
+ for (let feature in this.features) {
119
+ if (this.features[feature].attributes.Region === selectedRegion) {
120
+ regionFeatures.push(this.features[feature].attributes);
121
+ }
123
122
  }
124
- }
125
- return (
126
- <>
127
- <div className="use-cases-products-title">
128
- <span>{regionFeatures.length} </span>
129
- use cases
130
- </div>
131
- <div className="use-cases-products-list">
132
- <div key={selectedRegion} className="use-cases-dropdown">
133
- <button
134
- className="use-case-button-back"
135
- tabIndex="0"
136
- onClick={() => {
137
- navigationControl.showWorld(this);
138
- }}
139
- >
140
- <span className="esri-icon-left-arrow"></span>
141
- Back
142
- </button>
143
- {this.getDataBrief(regionFeatures)}
123
+ layerSpatial.definitionExpression = '';
124
+ return (
125
+ <div>
126
+ <div className="use-cases-products-title">
127
+ <span>{regionFeatures.length} </span>
128
+ use cases
129
+ </div>
130
+ <div className="use-cases-products-list">
131
+ <div key={selectedRegion} className="use-cases-dropdown">
132
+ <button
133
+ className="use-case-button-back"
134
+ tabIndex="0"
135
+ onClick={() => {
136
+ navigationControl.showWorld();
137
+ }}
138
+ >
139
+ <span className="esri-icon-left-arrow"></span>
140
+ Back
141
+ </button>
142
+ {this.getDataBrief(regionFeatures)}
143
+ </div>
144
144
  </div>
145
145
  </div>
146
- </>
147
- );
146
+ );
147
+ } else if (mapViewer.state.useCaseLevel === 3) {
148
+ layerSpatial.definitionExpression = `Latitude = ${mapViewer.state.selectedUseCases[0].attributes.Latitude} AND Longitude = ${mapViewer.state.selectedUseCases[0].attributes.Longitude}`;
149
+ for (let feature in mapViewer.state.selectedUseCases) {
150
+ regionFeatures.push(
151
+ mapViewer.state.selectedUseCases[feature].attributes,
152
+ );
153
+ }
154
+ return (
155
+ <>
156
+ <div className="use-cases-products-title">
157
+ <span>{regionFeatures.length} </span>
158
+ use cases
159
+ </div>
160
+ <div className="use-cases-products-list">
161
+ <div key={selectedRegion} className="use-cases-dropdown">
162
+ <button
163
+ className="use-case-button-back"
164
+ tabIndex="0"
165
+ onClick={() => {
166
+ navigationControl.returnToPrevious();
167
+ }}
168
+ >
169
+ <span className="esri-icon-left-arrow"></span>
170
+ Back
171
+ </button>
172
+ {this.getDataBrief(regionFeatures)}
173
+ </div>
174
+ </div>
175
+ </>
176
+ );
177
+ }
148
178
  }
149
179
 
150
180
  /**
@@ -261,7 +291,7 @@ class InfoWidget extends React.Component {
261
291
 
262
292
  this.features = features;
263
293
 
264
- this.setState((prevState) => ({
294
+ mapViewer.setState((prevState) => ({
265
295
  useCaseLevel: 1,
266
296
  region: '',
267
297
  selectedUseCase: '',
@@ -269,15 +299,26 @@ class InfoWidget extends React.Component {
269
299
  }));
270
300
  })();
271
301
  } else if (this.features !== undefined) {
272
- return (
273
- <>
274
- <div className="use-cases-products-title">
275
- <span>{this.features.length} </span>
276
- use cases
277
- </div>
278
- <div className="use-cases-products-list">{this.setDOMSummary()}</div>
279
- </>
280
- );
302
+ if (mapViewer.state.useCaseLevel !== 1) {
303
+ mapViewer.setState((prevState) => ({
304
+ useCaseLevel: 1,
305
+ region: '',
306
+ selectedUseCase: '',
307
+ previousState: prevState.useCaseLevel,
308
+ }));
309
+ } else {
310
+ return (
311
+ <>
312
+ <div className="use-cases-products-title">
313
+ <span>{this.features.length} </span>
314
+ use cases
315
+ </div>
316
+ <div className="use-cases-products-list">
317
+ {this.setDOMSummary()}
318
+ </div>
319
+ </>
320
+ );
321
+ }
281
322
  } else {
282
323
  return <></>;
283
324
  }
@@ -294,34 +335,23 @@ class InfoWidget extends React.Component {
294
335
  */
295
336
  highligtPoint(coords) {}
296
337
 
297
- /**
298
- * This methos will update the component.
299
- * @param {Object} nextProps
300
- */
301
- componentWillReceiveProps(nextProps) {
302
- this.setState((prevState) => ({
303
- useCaseLevel: nextProps.mapViewer.state.useCaseLevel,
304
- region: nextProps.mapViewer.state.region,
305
- selectedUseCase: nextProps.mapViewer.state.selectedUseCase,
306
- previousState: prevState.useCaseLevel,
307
- }));
308
- }
309
-
310
338
  /**
311
339
  * This method will return the corresponding lateral menu depending on layers.
312
340
  * @returns HTML
313
341
  */
314
342
  useCasesInformationPanel() {
315
- switch (this.state.useCaseLevel) {
343
+ switch (mapViewer.state.useCaseLevel) {
316
344
  case 1:
317
345
  return this.showSummary();
318
346
  case 2:
319
- return this.showBrief(this.state.region);
347
+ return this.showBrief(mapViewer.state.region);
320
348
  case 3:
321
- const title = this.state.selectedUseCase.Use_case_title;
322
- const bbox = this.state.selectedUseCase.BBOX;
323
- const region = this.state.selectedUseCase.Region;
324
- const country = this.state.selectedUseCase.Spatial_coverage;
349
+ return this.showBrief(mapViewer.state.selectedUseCases);
350
+ case 4:
351
+ const title = mapViewer.state.selectedUseCase.Use_case_title;
352
+ const bbox = mapViewer.state.selectedUseCase.BBOX;
353
+ const region = mapViewer.state.selectedUseCase.Region;
354
+ const country = mapViewer.state.selectedUseCase.Spatial_coverage;
325
355
  navigationControl.navigateToLocation(
326
356
  bbox,
327
357
  title,
@@ -329,7 +359,10 @@ class InfoWidget extends React.Component {
329
359
  country,
330
360
  layerSpatial,
331
361
  );
332
- return this.showUseCase(this.state.selectedUseCase);
362
+ document
363
+ .querySelector('.use-cases-products-list')
364
+ .scrollTo({ top: 0, behavior: 'smooth' });
365
+ return this.showUseCase(mapViewer.state.selectedUseCase);
333
366
  default:
334
367
  return 0;
335
368
  }
@@ -1,8 +1,9 @@
1
- let FeatureLayer, Extent;
1
+ let FeatureLayer, Extent, mapViewer;
2
2
  class LayerControl {
3
3
  constructor(props) {
4
4
  this.map = props.map;
5
5
  this.view = props.view;
6
+ mapViewer = props.mapViewer;
6
7
  FeatureLayer = props.FeatureLayer;
7
8
  Extent = props.Extent;
8
9
  }
@@ -96,6 +97,32 @@ class LayerControl {
96
97
  return pointInformation;
97
98
  }
98
99
 
100
+ getRegionInfo(region, callback) {
101
+ const xmlhttp = new XMLHttpRequest();
102
+ const url = `${mapViewer.spatialConfig.url}/query?where=Region+%3D+%27${region}%27&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&having=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&historicMoment=&returnDistinctValues=false&resultOffset=&resultRecordCount=&queryByDistance=&returnExtentOnly=false&datumTransformation=&parameterValues=&rangeValues=&quantizationParameters=&featureEncoding=esriDefault&f=pjson`;
103
+ xmlhttp.onreadystatechange = () => {
104
+ if (xmlhttp.readyState === 4 && xmlhttp.status === 200)
105
+ callback(this.returnData(xmlhttp), mapViewer);
106
+ };
107
+ xmlhttp.open('GET', url, true);
108
+ xmlhttp.send();
109
+ }
110
+
111
+ checkIfMorePoints(latLon, callback) {
112
+ const xmlhttp = new XMLHttpRequest();
113
+ const url = `${mapViewer.spatialConfig.url}/query?where=Latitude%3D+${latLon.latitude}+AND+Longitude%3D+${latLon.longitude}&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&having=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&historicMoment=&returnDistinctValues=false&resultOffset=&resultRecordCount=&queryByDistance=&returnExtentOnly=false&datumTransformation=&parameterValues=&rangeValues=&quantizationParameters=&featureEncoding=esriDefault&f=pjson`;
114
+ xmlhttp.onreadystatechange = () => {
115
+ if (xmlhttp.readyState === 4 && xmlhttp.status === 200)
116
+ callback(this.returnData(xmlhttp), mapViewer);
117
+ };
118
+ xmlhttp.open('GET', url, true);
119
+ xmlhttp.send();
120
+ }
121
+
122
+ returnData(xmlhttp) {
123
+ return JSON.parse(xmlhttp.responseText);
124
+ }
125
+
99
126
  /**
100
127
  * Order retreived features by Service product name
101
128
  * @param {Object} features
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- let layerRegion, layerSpatial;
3
+ let layerRegion, layerSpatial, mapViewer;
4
4
  class NavigationControl extends React.Component {
5
5
  constructor(props) {
6
6
  super(props);
@@ -8,28 +8,21 @@ class NavigationControl extends React.Component {
8
8
  this.view = props.view;
9
9
  this.center = props.center;
10
10
  this.layerControl = props.layerControl;
11
+ mapViewer = props.mapViewer;
11
12
  layerRegion = props.layerRegion;
12
13
  layerSpatial = props.layerSpatial;
13
14
  }
14
15
 
15
16
  /**
16
17
  * Establish the initial behavior
17
- * @param {InfoWidget} infoWidget
18
18
  */
19
- showWorld(infoWidget) {
19
+ showWorld() {
20
20
  this.layerControl.hideLayer(layerSpatial.id);
21
21
  this.layerControl.showLayer(layerRegion.id);
22
- if (this.view.center) {
23
- this.view.center.latitude = this.center[1];
24
- this.view.center.longitude = this.center[0];
25
- } else {
26
- this.view.center = {
27
- latitude: this.center[1],
28
- longitude: this.center[0],
29
- };
30
- }
31
- this.view.zoom = 1;
32
- infoWidget.setState(() => ({
22
+ this.view.center = this.center;
23
+ this.view.zoom = 0;
24
+
25
+ mapViewer.setState(() => ({
33
26
  useCaseLevel: 1,
34
27
  }));
35
28
  }
@@ -85,32 +78,36 @@ class NavigationControl extends React.Component {
85
78
 
86
79
  /**
87
80
  * Returns to the previous status.
88
- * @param {InfoWidget} infoWidget
81
+
89
82
  */
90
- returnToPrevious(infoWidget) {
83
+ returnToPrevious() {
91
84
  switch (
92
- infoWidget.state.previousState === infoWidget.state.useCaseLevel
93
- ? infoWidget.state.useCaseLevel - 1
94
- : infoWidget.state.previousState
85
+ mapViewer.state.previousState === mapViewer.state.useCaseLevel
86
+ ? mapViewer.state.useCaseLevel - 1
87
+ : mapViewer.state.previousState
95
88
  ) {
96
89
  case 1:
97
- this.showWorld(infoWidget);
90
+ this.showWorld();
98
91
  break;
99
92
 
100
93
  case 2:
101
94
  this.navigateToRegion(
102
- infoWidget.state.selectedUseCase.BBOX,
103
- infoWidget.state.selectedUseCase.Region,
95
+ mapViewer.state.selectedUseCase.BBOX,
96
+ mapViewer.state.selectedUseCase.Region,
104
97
  layerSpatial,
105
98
  );
106
- infoWidget.setState(() => ({
99
+ mapViewer.setState(() => ({
107
100
  useCaseLevel: 2,
108
- region: infoWidget.state.selectedUseCase.Region,
101
+ region: mapViewer.state.selectedUseCase.Region,
102
+ }));
103
+ break;
104
+ case 3:
105
+ mapViewer.setState(() => ({
106
+ useCaseLevel: 3,
109
107
  }));
110
108
  break;
111
-
112
109
  default:
113
- this.showWorld(infoWidget);
110
+ this.showWorld();
114
111
  break;
115
112
  }
116
113
  }
@@ -42,6 +42,13 @@ class UseCasesMapViewer extends React.Component {
42
42
  render: props.cfg.RegionMarkerRenderer,
43
43
  label: props.cfg.RegionLabel,
44
44
  };
45
+ this.state = {
46
+ useCaseLevel: 1,
47
+ region: '',
48
+ selectedUseCase: '',
49
+ selectedUseCases: [],
50
+ previousState: 1,
51
+ };
45
52
  }
46
53
 
47
54
  loader() {
@@ -115,6 +122,7 @@ class UseCasesMapViewer extends React.Component {
115
122
  layerControl = new LayerControl({
116
123
  map: this.map,
117
124
  view: this.view,
125
+ mapViewer: this,
118
126
  FeatureLayer: FeatureLayer,
119
127
  Extent: Extent,
120
128
  });
@@ -143,6 +151,7 @@ class UseCasesMapViewer extends React.Component {
143
151
  view: this.view,
144
152
  center: this.mapCfg.center,
145
153
  layerControl: layerControl,
154
+ mapViewer: this,
146
155
  layerRegion: layerRegion,
147
156
  layerSpatial: layerSpatial,
148
157
  });
@@ -162,20 +171,6 @@ class UseCasesMapViewer extends React.Component {
162
171
  this.setState(() => ({ useCaseLevel: 1 }));
163
172
  }
164
173
 
165
- getRegionInfo(region, callback) {
166
- let xmlhttp;
167
- const url = `${this.spatialConfig.url}/query?where=Region+%3D+%27${region}%27&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&having=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&historicMoment=&returnDistinctValues=false&resultOffset=&resultRecordCount=&queryByDistance=&returnExtentOnly=false&datumTransformation=&parameterValues=&rangeValues=&quantizationParameters=&featureEncoding=esriDefault&f=pjson`;
168
- xmlhttp = new XMLHttpRequest();
169
- xmlhttp.onreadystatechange = function () {
170
- if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
171
- let data = JSON.parse(this.responseText);
172
- callback(data);
173
- }
174
- };
175
- xmlhttp.open('GET', url, true);
176
- xmlhttp.send();
177
- }
178
-
179
174
  /**
180
175
  * This method will disable all the functionalities on the map
181
176
  * @param {MapView} view
@@ -184,6 +179,8 @@ class UseCasesMapViewer extends React.Component {
184
179
  * @param {FeatureLayer} layerSpatial
185
180
  */
186
181
  setMapFunctions(view, layerControl, navigationControl, layerSpatial) {
182
+ const prohibitedKeys = ['+', '-', 'Shift', '_', '='];
183
+
187
184
  view.on('mouse-wheel', function (event) {
188
185
  event.stopPropagation();
189
186
  });
@@ -203,12 +200,9 @@ class UseCasesMapViewer extends React.Component {
203
200
  view.on('drag', ['Shift'], function (event) {
204
201
  event.stopPropagation();
205
202
  });
206
-
207
203
  view.on('drag', ['Shift', 'Control'], function (event) {
208
204
  event.stopPropagation();
209
205
  });
210
-
211
- const prohibitedKeys = ['+', '-', 'Shift', '_', '='];
212
206
  view.on('key-down', function (event) {
213
207
  const keyPressed = event.key;
214
208
  if (prohibitedKeys.indexOf(keyPressed) !== -1) {
@@ -225,13 +219,13 @@ class UseCasesMapViewer extends React.Component {
225
219
  const screenPoint = { x: e.x, y: e.y };
226
220
 
227
221
  (async () => {
228
- const selectedPoint = await layerControl.getPointInfo(screenPoint);
222
+ let selectedPoint = await layerControl.getPointInfo(screenPoint);
229
223
  if (selectedPoint.BBOX) {
230
224
  const selectedRegion = selectedPoint.Region;
231
225
  const boundingBox = selectedPoint.BBOX;
232
226
  const selectedTitle = selectedPoint.Use_case_title;
233
227
  const selectedSpatial = selectedPoint.Spatial_coverage;
234
- if (this.state.useCaseLevel === 1) {
228
+ if (this.state.useCaseLevel === 1 && selectedPoint.COUNT > 1) {
235
229
  navigationControl.navigateToRegion(
236
230
  boundingBox,
237
231
  selectedRegion,
@@ -244,25 +238,67 @@ class UseCasesMapViewer extends React.Component {
244
238
  previousState: prevState.useCaseLevel,
245
239
  };
246
240
  });
247
- view.popup.close();
248
- this.popupOnce = true;
249
- document.querySelector('.map').style.cursor = '';
250
- } else if (this.state.useCaseLevel === 2) {
251
- navigationControl.navigateToLocation(
252
- boundingBox,
253
- selectedTitle,
254
- selectedRegion,
255
- selectedSpatial,
256
- layerSpatial,
257
- );
258
- this.setState((prevState) => {
259
- return {
260
- useCaseLevel: 3,
261
- selectedUseCase: selectedPoint,
262
- previousState: prevState.useCaseLevel,
241
+ } else if (
242
+ this.state.useCaseLevel === 2 ||
243
+ selectedPoint.COUNT === 1
244
+ ) {
245
+ if (!layerSpatial.visible && selectedPoint.COUNT === 1) {
246
+ layerControl.getRegionInfo(
247
+ selectedRegion,
248
+ (data, MapViewerThis) => {
249
+ data = data.features[0].attributes;
250
+ navigationControl.navigateToRegion(
251
+ data.BBOX,
252
+ data.Region,
253
+ layerSpatial,
254
+ );
255
+
256
+ MapViewerThis.setState((prevState) => {
257
+ return {
258
+ useCaseLevel: 4,
259
+ selectedUseCase: data,
260
+ region: data.Region,
261
+ previousState: prevState.useCaseLevel,
262
+ };
263
+ });
264
+ },
265
+ );
266
+ } else {
267
+ const latLon = {
268
+ latitude: selectedPoint.Latitude,
269
+ longitude: selectedPoint.Longitude,
263
270
  };
264
- });
271
+ layerControl.checkIfMorePoints(latLon, (data, MapViewerThis) => {
272
+ if (data.features.length !== 1) {
273
+ MapViewerThis.setState((prevState) => {
274
+ return {
275
+ useCaseLevel: 3,
276
+ selectedUseCases: data.features,
277
+ previousState: prevState.useCaseLevel,
278
+ };
279
+ });
280
+ } else {
281
+ navigationControl.navigateToLocation(
282
+ boundingBox,
283
+ selectedTitle,
284
+ selectedRegion,
285
+ selectedSpatial,
286
+ layerSpatial,
287
+ );
288
+ MapViewerThis.setState((prevState) => {
289
+ return {
290
+ useCaseLevel: 4,
291
+ selectedUseCase: selectedPoint,
292
+ previousState: prevState.useCaseLevel,
293
+ };
294
+ });
295
+ }
296
+ });
297
+ }
265
298
  }
299
+ view.popup.close();
300
+ this.popupOnce = true;
301
+ document.querySelector('.map').style.cursor = '';
266
302
  }
267
303
  })();
268
304
  });
@@ -273,13 +309,7 @@ class UseCasesMapViewer extends React.Component {
273
309
  y: e.y,
274
310
  };
275
311
 
276
- let useCaseLevel = document.querySelector('.use-case-button-back')
277
- ? 2
278
- : document.querySelector('.use-cases-products-list')
279
- ? 1
280
- : 3;
281
-
282
- if (useCaseLevel === 1) {
312
+ if (this.state.useCaseLevel === 1) {
283
313
  view.hitTest(screenPoint).then((response) => {
284
314
  if (response.results.length > 1) {
285
315
  if (
@@ -290,11 +320,9 @@ class UseCasesMapViewer extends React.Component {
290
320
  document.querySelector('.map').style.cursor = 'pointer';
291
321
  let region = response.results[0].graphic.attributes.Region;
292
322
 
293
- this.getRegionInfo(region, (data) => {
323
+ layerControl.getRegionInfo(region, (data) => {
294
324
  let data_eu = data.features.filter(
295
- (a) =>
296
- a.attributes.Spatial_coverage === 'EU' ||
297
- a.attributes.Spatial_coverage === 'UK',
325
+ (a) => a.attributes.Spatial_coverage === 'EU',
298
326
  ).length;
299
327
  let data_eea = data.features.filter(
300
328
  (a) => a.attributes.Spatial_coverage === 'EEA',
@@ -305,7 +333,6 @@ class UseCasesMapViewer extends React.Component {
305
333
  let data_country = data.features.filter(
306
334
  (a) =>
307
335
  a.attributes.Spatial_coverage !== 'EU' &&
308
- a.attributes.Spatial_coverage !== 'UK' &&
309
336
  a.attributes.Spatial_coverage !== 'EEA' &&
310
337
  a.attributes.Spatial_coverage !== 'GLOBAL',
311
338
  ).length;
@@ -339,7 +366,7 @@ class UseCasesMapViewer extends React.Component {
339
366
  document.querySelector('.map').style.cursor = '';
340
367
  }
341
368
  });
342
- } else if (useCaseLevel === 2) {
369
+ } else if (this.state.useCaseLevel === 2) {
343
370
  view.hitTest(screenPoint).then((response) => {
344
371
  if (response.results.length > 1) {
345
372
  if (
@@ -15,8 +15,8 @@ const greenRegion = '#acba47';
15
15
  const config = {
16
16
  Map: {
17
17
  div: 'mapDiv',
18
- center: [15, 50],
19
- zoom: 1,
18
+ center: [10.78, 30],
19
+ zoom: 0,
20
20
  },
21
21
  Services: {
22
22
  RegionLayer:
@@ -53,7 +53,7 @@
53
53
  }
54
54
 
55
55
  .use-cases-products-list {
56
- max-height: 25rem;
56
+ height: 25rem;
57
57
  overflow-y: auto;
58
58
  }
59
59