@eeacms/volto-arcgis-block 0.1.21 → 0.1.25

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.
@@ -19,10 +19,7 @@ class TimesliderWidget extends React.Component {
19
19
  }
20
20
 
21
21
  loader() {
22
- return loadModules([
23
- 'esri/widgets/TimeSlider',
24
- 'esri/layers/WMSLayer',
25
- ]).then(([_TimeSlider]) => {
22
+ return loadModules(['esri/widgets/TimeSlider']).then(([_TimeSlider]) => {
26
23
  [TimeSlider] = [_TimeSlider];
27
24
  });
28
25
  }
@@ -60,6 +57,9 @@ class TimesliderWidget extends React.Component {
60
57
  });
61
58
 
62
59
  this.TimesliderWidget.watch('timeExtent', (timeExtent) => {
60
+ if (!this.container.current ? true : false) {
61
+ this.TimesliderWidget.stop();
62
+ }
63
63
  let start = new Date(timeExtent.start).getTime();
64
64
  let end = new Date(timeExtent.end).getTime();
65
65
  this.props.time.elem.setAttribute('time-start', start);
@@ -37,6 +37,11 @@
37
37
  max-height: 250px !important;
38
38
  }
39
39
 
40
+ .esri-ui-top-right,
41
+ .esri-ui-top-left {
42
+ z-index: 1;
43
+ }
44
+
40
45
  .esri-component.esri-zoom.esri-widget {
41
46
  background: none;
42
47
  box-shadow: none;
@@ -76,6 +81,10 @@
76
81
  order: 5;
77
82
  }
78
83
 
84
+ .info-container {
85
+ order: 6;
86
+ }
87
+
79
88
  /* Basemap */
80
89
  .basemap-container {
81
90
  display: flex;
@@ -586,6 +595,26 @@
586
595
  overflow: auto;
587
596
  }
588
597
 
598
+ /* Pixel info */
599
+ .info-container {
600
+ display: flex;
601
+ box-shadow: none !important;
602
+ }
603
+
604
+ .info-panel {
605
+ display: none;
606
+ overflow: auto;
607
+ width: 300px;
608
+ max-height: 240px;
609
+ padding: 1rem;
610
+ background-color: white;
611
+ font-size: 1rem;
612
+ }
613
+
614
+ .info-panel select {
615
+ margin-bottom: 1rem;
616
+ }
617
+
589
618
  /* Modal */
590
619
  .map-download-modal.ui.modal {
591
620
  margin: 0 !important;
@@ -5,7 +5,6 @@ let layerControl,
5
5
  view,
6
6
  mapViewer,
7
7
  layerSpatial,
8
- layerNUTS,
9
8
  processedData = [];
10
9
  class InfoWidget extends React.Component {
11
10
  constructor(props) {
@@ -15,7 +14,6 @@ class InfoWidget extends React.Component {
15
14
  navigationControl = props.navigationControl;
16
15
  layerControl = props.layerControl;
17
16
  layerSpatial = props.layerSpatial;
18
- layerNUTS = props.layerNUTS;
19
17
  this.container = createRef();
20
18
  }
21
19
 
@@ -25,13 +23,11 @@ class InfoWidget extends React.Component {
25
23
  * @returns lateralMenu DOM
26
24
  */
27
25
  showUseCase(UseCase) {
28
- layerControl.getGeometry(UseCase.Spatial_coverage, layerNUTS);
29
26
  let responsibleOrganizationOrPerson = UseCase.Responsible_organisation
30
27
  ? UseCase.Responsible_organisation
31
28
  : UseCase.Contact_person_name_
32
29
  ? UseCase.Contact_person_name_
33
30
  : '';
34
- layerControl.showLayer(layerNUTS.id);
35
31
  return (
36
32
  <>
37
33
  <div className="use-cases-products-title">Use case detail</div>
@@ -46,7 +42,14 @@ class InfoWidget extends React.Component {
46
42
  ></span>
47
43
  </div>
48
44
  <div className="use-case-detail-image">
49
- <img src={UseCase.Link_to_image} alt="Use Case" />
45
+ <img
46
+ src={
47
+ UseCase.Link_to_image
48
+ ? UseCase.Link_to_image
49
+ : this.props.thumbnail
50
+ }
51
+ alt="Use Case"
52
+ />
50
53
  </div>
51
54
  <div className="use-case-detail-content">
52
55
  <div className="use-case-detail-product">
@@ -28,11 +28,11 @@ class LayerControl {
28
28
  }
29
29
 
30
30
  getGeometry(country, layer) {
31
- layer.definitionExpression = `LEVL_CODE = 0 AND (`;
31
+ layer.definitionExpression = `(`;
32
32
  if (country === 'EU' || country === 'EEA') {
33
33
  let states = mapViewer.props.cfg.Codes[country];
34
34
  for (let i = 0; i < states.length; i++) {
35
- layer.definitionExpression += `CNTR_CODE = '${states[i]}'`;
35
+ layer.definitionExpression += `CNTR_ID = '${states[i]}'`;
36
36
  if (i < states.length - 1) {
37
37
  layer.definitionExpression += ' OR ';
38
38
  } else {
@@ -40,7 +40,7 @@ class LayerControl {
40
40
  }
41
41
  }
42
42
  } else {
43
- layer.definitionExpression += `CNTR_CODE = 'none')`;
43
+ layer.definitionExpression += `CNTR_ID = '${country}')`;
44
44
  }
45
45
  }
46
46
 
@@ -48,7 +48,7 @@ class LegendWidget extends React.Component {
48
48
 
49
49
  this.container.current.children[1].querySelector(
50
50
  '.esri-legend__service-label',
51
- ).textContent = 'Use Cases Coverage Legend';
51
+ ).textContent = 'Legend';
52
52
 
53
53
  try {
54
54
  this.container.current.children[1]
@@ -63,18 +63,24 @@ class LegendWidget extends React.Component {
63
63
  let currentValue = legendCells[i].textContent;
64
64
  switch (currentValue.toLowerCase()) {
65
65
  case 'eu':
66
- legendCells[i].textContent = 'EU27+UK';
66
+ legendCells[i].textContent = 'EU27+UK coverage';
67
67
  break;
68
68
  case 'eea':
69
- legendCells[i].textContent = 'EEA 38';
69
+ legendCells[i].textContent = 'EEA38+UK coverage';
70
70
  break;
71
71
  case 'others':
72
- legendCells[i].textContent = 'Country';
72
+ legendCells[i].textContent = 'Country coverage';
73
73
  break;
74
74
  default:
75
75
  break;
76
76
  }
77
77
  }
78
+
79
+ let legendRow = document.querySelectorAll('.esri-legend__layer-row');
80
+ for (let i = 0; i < legendRow.length; i++) {
81
+ legendRow[i].textContent.toLowerCase() === 'global' &&
82
+ legendRow[i].remove();
83
+ }
78
84
  // By invoking the setState, we notify the state we want to reach
79
85
  // and ensure that the component is rendered again
80
86
  this.mapViewer.setState({ showMapMenu: true });
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- let layerRegion, layerSpatial, layerNUTS, mapViewer;
3
+ let layerRegion, layerSpatial, layerHighlight, mapViewer;
4
4
  class NavigationControl extends React.Component {
5
5
  constructor(props) {
6
6
  super(props);
@@ -11,7 +11,7 @@ class NavigationControl extends React.Component {
11
11
  mapViewer = props.mapViewer;
12
12
  layerRegion = props.layerRegion;
13
13
  layerSpatial = props.layerSpatial;
14
- layerNUTS = props.layerNUTS;
14
+ layerHighlight = props.layerHighlight;
15
15
  }
16
16
 
17
17
  /**
@@ -82,8 +82,7 @@ class NavigationControl extends React.Component {
82
82
 
83
83
  */
84
84
  returnToPrevious() {
85
- // this.layerControl.hideLayer(layerNUTS.id);
86
- this.layerControl.getGeometry('none', layerNUTS);
85
+ // this.layerControl.hideLayer(layerHighlight.id);
87
86
 
88
87
  switch (
89
88
  mapViewer.state.previousState === mapViewer.state.useCaseLevel
@@ -91,10 +90,12 @@ class NavigationControl extends React.Component {
91
90
  : mapViewer.state.previousState
92
91
  ) {
93
92
  case 1:
93
+ this.layerControl.getGeometry('none', layerHighlight);
94
94
  this.showWorld();
95
95
  break;
96
96
 
97
97
  case 2:
98
+ this.layerControl.getGeometry('none', layerHighlight);
98
99
  this.navigateToRegion(
99
100
  mapViewer.state.selectedUseCase.BBOX,
100
101
  mapViewer.state.selectedUseCase.Region,
@@ -17,7 +17,7 @@ let Map,
17
17
  layerControl,
18
18
  navigationControl,
19
19
  layerSpatial,
20
- layerNUTS;
20
+ layerHighlight;
21
21
 
22
22
  class UseCasesMapViewer extends React.Component {
23
23
  constructor(props) {
@@ -27,6 +27,7 @@ class UseCasesMapViewer extends React.Component {
27
27
  this.serviceCfg = props.cfg.Services;
28
28
  this.compCfg = this.props.cfg.Components;
29
29
  this.url = this.props.cfg.url;
30
+ this.thumbnail = this.props.cfg.Thumbnail;
30
31
  this.map = null;
31
32
  this.id = props.id;
32
33
  this.popupOnce = false;
@@ -47,10 +48,10 @@ class UseCasesMapViewer extends React.Component {
47
48
  label: props.cfg.RegionLabel,
48
49
  showLegend: false,
49
50
  };
50
- this.NUTSConfig = {
51
- id: 'NUTSLayer',
52
- url: props.cfg.Services.NUTS_service,
53
- render: props.cfg.NUTSRenderer,
51
+ this.HighlightConfig = {
52
+ id: 'HightlightLayer',
53
+ url: props.cfg.Services.Highlight_service,
54
+ render: props.cfg.HightlightRenderer,
54
55
  showLegend: false,
55
56
  };
56
57
  this.state = {
@@ -155,21 +156,21 @@ class UseCasesMapViewer extends React.Component {
155
156
  legend: this.regionConfig.showLegend,
156
157
  });
157
158
 
158
- layerNUTS = layerControl.createLayer({
159
- id: this.NUTSConfig.id,
160
- url: this.NUTSConfig.url,
161
- legend: this.NUTSConfig.showLegend,
159
+ layerHighlight = layerControl.createLayer({
160
+ id: this.HighlightConfig.id,
161
+ url: this.HighlightConfig.url,
162
+ legend: this.HighlightConfig.showLegend,
162
163
  });
163
164
 
164
165
  layerRegion.renderer = this.regionConfig.render;
165
166
  layerRegion.labelingInfo = [this.regionConfig.label];
166
- layerNUTS.renderer = this.NUTSConfig.render;
167
+ layerHighlight.renderer = this.HighlightConfig.render;
167
168
 
168
- layerControl.addLayer(layerNUTS);
169
+ layerControl.addLayer(layerHighlight);
169
170
  layerControl.addLayer(layerRegion);
170
171
  layerControl.addLayer(layerSpatial);
171
172
 
172
- layerControl.hideLayer(layerNUTS.id);
173
+ layerControl.hideLayer(layerHighlight.id);
173
174
  layerControl.hideLayer(layerSpatial.id);
174
175
 
175
176
  navigationControl = new NavigationControl({
@@ -180,7 +181,7 @@ class UseCasesMapViewer extends React.Component {
180
181
  mapViewer: this,
181
182
  layerRegion: layerRegion,
182
183
  layerSpatial: layerSpatial,
183
- layerNUTS: layerNUTS,
184
+ layerHighlight: layerHighlight,
184
185
  });
185
186
 
186
187
  this.setMapFunctions(
@@ -297,6 +298,8 @@ class UseCasesMapViewer extends React.Component {
297
298
  longitude: selectedPoint.Longitude,
298
299
  };
299
300
  layerControl.checkIfMorePoints(latLon, (data, MapViewerThis) => {
301
+ layerControl.getGeometry(selectedSpatial, layerHighlight);
302
+ layerControl.showLayer(layerHighlight.id);
300
303
  if (data.features.length !== 1) {
301
304
  MapViewerThis.setState((prevState) => {
302
305
  return {
@@ -422,7 +425,8 @@ class UseCasesMapViewer extends React.Component {
422
425
  layerControl={layerControl}
423
426
  navigationControl={navigationControl}
424
427
  layerSpatial={layerSpatial}
425
- layerNUTS={layerNUTS}
428
+ thumbnail={this.thumbnail}
429
+ layerHighlight={layerHighlight}
426
430
  />
427
431
  );
428
432
  }
@@ -33,13 +33,16 @@ const config = {
33
33
  ],
34
34
  },
35
35
  Services: {
36
- NUTS_service:
37
- 'https://bm-eugis.tk/arcgis/rest/services/CLMS/NUTS_2021/MapServer/0',
36
+ Highlight_service:
37
+ 'https://trial.discomap.eea.europa.eu/arcgis/rest/services/CLMS/UseCasesWorldCountries/MapServer/1',
38
38
  RegionLayer:
39
- 'https://bm-eugis.tk/arcgis/rest/services/CLMS/UseCasesRegion_count/MapServer/0',
39
+ 'https://trial.discomap.eea.europa.eu/arcgis/rest/services/CLMS/UseCasesRegion_count/MapServer/0',
40
40
  SpatialCoverageLayer:
41
- 'https://bm-eugis.tk/arcgis/rest/services/CLMS/UseCasesSpatialCoverage/MapServer/0',
41
+ 'https://trial.discomap.eea.europa.eu/arcgis/rest/services/CLMS/UseCasesSpatialCoverage/MapServer/0',
42
42
  },
43
+ Thumbnail:
44
+ 'https://eu-copernicus.github.io/copernicus-component-library/assets/images/image_placeholder.jpg',
45
+
43
46
  Codes: {
44
47
  EU: [
45
48
  'BE',
@@ -116,7 +119,7 @@ const config = {
116
119
  ],
117
120
  },
118
121
 
119
- NUTSRenderer: {
122
+ HightlightRenderer: {
120
123
  type: 'unique-value',
121
124
  field: 'LEVL_CODE',
122
125
  defaultSymbol: {