@eeacms/volto-arcgis-block 0.1.171 → 0.1.173

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,7 +4,14 @@ 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.171](https://github.com/eea/volto-arcgis-block/compare/0.1.170...0.1.171) - 14 July 2023
7
+ ### [0.1.173](https://github.com/eea/volto-arcgis-block/compare/0.1.172...0.1.173) - 17 July 2023
8
+
9
+ ### [0.1.172](https://github.com/eea/volto-arcgis-block/compare/0.1.171...0.1.172) - 17 July 2023
10
+
11
+ #### :hammer_and_wrench: Others
12
+
13
+ - CLMS-2318 (feat): Hardcoded urls in LegendWidget and HotspotWidget now are readed from config.js [Urkorue - [`9f7adc3`](https://github.com/eea/volto-arcgis-block/commit/9f7adc30b818de8940d778b1eafcbfe210352470)]
14
+ ### [0.1.171](https://github.com/eea/volto-arcgis-block/compare/0.1.170...0.1.171) - 17 July 2023
8
15
 
9
16
  ### [0.1.170](https://github.com/eea/volto-arcgis-block/compare/0.1.169...0.1.170) - 13 July 2023
10
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.171",
3
+ "version": "0.1.173",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -44,6 +44,7 @@ class HotspotWidget extends React.Component {
44
44
  this.selectedArea = null;
45
45
  this.lcYear = null;
46
46
  this.lccYear = null;
47
+ this.urls = this.props.urls;
47
48
  }
48
49
 
49
50
  loader() {
@@ -59,7 +60,7 @@ class HotspotWidget extends React.Component {
59
60
  }
60
61
 
61
62
  getBBoxData = () => {
62
- const url = 'https://land.copernicus.eu/global/hsm/php/klc_bbox.php';
63
+ const url = this.urls.klc_bbox;
63
64
  return esriRequest(url, {
64
65
  responseType: 'json',
65
66
  }).then((response) => {
@@ -102,15 +103,12 @@ class HotspotWidget extends React.Component {
102
103
  }
103
104
 
104
105
  addLegendNameToUrl(legend) {
105
- const legendLinkUrl =
106
- 'https://geospatial.jrc.ec.europa.eu/geoserver/hotspots/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=';
106
+ const legendLinkUrl = this.urls.legendLinkUrl;
107
107
  return legendLinkUrl + legend;
108
108
  }
109
109
 
110
110
  layerModelInit() {
111
- const serviceUrl =
112
- 'https://geospatial.jrc.ec.europa.eu/geoserver/hotspots/wms';
113
-
111
+ const serviceUrl = this.urls.serviceUrl;
114
112
  this.esriLayer_lcc = new WMSLayer({
115
113
  url: serviceUrl,
116
114
  //featureInfoFormat: "application/json",
@@ -397,7 +395,7 @@ class HotspotWidget extends React.Component {
397
395
  }
398
396
 
399
397
  getLayerParameters() {
400
- fetch('https://land.copernicus.eu/global/hsm/all_geo_klc_json')
398
+ fetch(this.urls.all_geo_klc)
401
399
  .then((data) => {
402
400
  if (data.status === 200) {
403
401
  return data.json();
@@ -21,6 +21,7 @@ class LegendWidget extends React.Component {
21
21
  this.mapViewer = this.props.mapViewer;
22
22
  this.menuClass =
23
23
  'esri-icon-legend esri-widget--button esri-widget esri-interactive';
24
+ this.urls = this.props.urls;
24
25
  }
25
26
 
26
27
  hideNutsLegend() {
@@ -55,53 +56,28 @@ class LegendWidget extends React.Component {
55
56
  if (!(img.complete && img.naturalHeight !== 0)) {
56
57
  // If img src returns a broken link
57
58
  if (img?.src?.includes('all_present_lc_a_pol')) {
58
- //img.src =
59
- // 'https://clmsdemo.devel6cph.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/dichotomous-reference-land-cover.png/@@images/image-283-df1c7b022cfd505c9bab4b4be08cd4f5.png';
60
-
61
- //prod
62
- img.src =
63
- 'https://clms-prod.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/dichotomous-reference-land-cover.png/@@images/image-800-8e5528b4247acef813af4b91d30a22d1.png';
59
+ img.src = this.urls.all_present_lc_a_pol;
64
60
 
65
61
  img.parentNode.parentNode.parentNode.parentNode.firstElementChild.style.display =
66
62
  'none';
67
63
  return;
68
64
  } else if (img?.src?.includes('all_present_lc_b_pol')) {
69
- //img.src =
70
- // 'https://clmsdemo.devel6cph.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/modular-reference-land-cover.png/@@images/image-312-a552fdf4af5b831c1af6cd039ad9ae2b.png';
71
-
72
- //prod
73
- img.src =
74
- 'https://clmsdemo.devel6cph.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/modular-reference-land-cover.png/@@images/image-800-97f58b15239b2b3ea85d701e171eaf64.png';
65
+ img.src = this.urls.all_present_lc_b_pol;
75
66
 
76
67
  img.parentNode.parentNode.parentNode.parentNode.firstElementChild.style.display =
77
68
  'none';
78
69
  } else if (img?.src?.includes('all_lcc_a_pol')) {
79
- //img.src =
80
- // 'https://clmsdemo.devel6cph.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/dichotomous-land-cover-change.png/@@images/image-324-83819bb107020e7fdab5764d199b000d.png';
81
-
82
- //prod
83
- img.src =
84
- 'https://clms-prod.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/dichotomous-land-cover-change.png/@@images/image-800-e77885afc5da8e0535f648b563e60408.png';
70
+ img.src = this.urls.all_lcc_a_pol;
85
71
 
86
72
  img.parentNode.parentNode.parentNode.parentNode.firstElementChild.style.display =
87
73
  'none';
88
74
  } else if (img?.src?.includes('all_lcc_b_pol')) {
89
- //img.src =
90
- // 'https://clmsdemo.devel6cph.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/modular-land-cover-change.png/@@images/image-314-30a9e6f64333da441b830fc31875c011.png';
91
-
92
- //prod
93
- img.src =
94
- 'https://clms-prod.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/modular-land-cover-change.png/@@images/image-800-7e36e74d09ddd7e3f94fb502f0b5be8e.png';
75
+ img.src = this.urls.all_lcc_b_pol;
95
76
 
96
77
  img.parentNode.parentNode.parentNode.parentNode.firstElementChild.style.display =
97
78
  'none';
98
79
  } else if (img?.src?.includes('cop_klc')) {
99
- //img.src =
100
- // 'https://clmsdemo.devel6cph.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/key-landscapes-for-conservation-borders.png/@@images/image-278-ebd9539bdc95d6a1028a01cd59efd680.png';
101
-
102
- //prod
103
- img.src =
104
- 'https://clms-prod.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/key-landscapes-for-conservation-borders.png/@@images/image-800-28ced0e8616b9a414ea5076399a5ba4e.png';
80
+ img.src = this.urls.cop_klc;
105
81
 
106
82
  img.parentNode.parentNode.parentNode.parentNode.firstElementChild.style.display =
107
83
  'none';
@@ -279,6 +279,7 @@ class MapViewer extends React.Component {
279
279
  view={this.view}
280
280
  mapViewer={this}
281
281
  download={this.props.mapviewer_config.Download}
282
+ urls={this.cfgUrls}
282
283
  />
283
284
  );
284
285
  }
@@ -325,6 +326,7 @@ class MapViewer extends React.Component {
325
326
  mapViewer={this}
326
327
  layers={sessionStorage}
327
328
  mapCfg={this.mapCfg}
329
+ urls={this.cfgUrls}
328
330
  />
329
331
  );
330
332
  }
@@ -1006,7 +1006,6 @@ class MenuWidget extends React.Component {
1006
1006
  let style = this.props.download
1007
1007
  ? { paddingLeft: dataset.HandlingLevel ? '0' : '1rem' }
1008
1008
  : {};
1009
-
1010
1009
  if (dataset.HandlingLevel) {
1011
1010
  this.layerGroups[dataset.DatasetId] = [];
1012
1011
  }
@@ -1157,11 +1156,8 @@ class MenuWidget extends React.Component {
1157
1156
  {description ? (
1158
1157
  <Popup
1159
1158
  trigger={
1160
- (checkedLayers &&
1161
- checkedLayers.includes(dataset.Layer.LayerId) &&
1162
- dataset.ProductId ===
1163
- '8474c3b080fa42cc837f1d2338fcf096') ||
1164
- dataset.Product === 'Snow and Ice Parameters' ? (
1159
+ dataset.ProductId ===
1160
+ '8474c3b080fa42cc837f1d2338fcf096' ? (
1165
1161
  <div class="zoom-in-message-container">
1166
1162
  <span>{dataset.DatasetTitle}</span>
1167
1163
  <div class="zoom-in-message zoom-in-message-dataset">
@@ -1178,9 +1174,7 @@ class MenuWidget extends React.Component {
1178
1174
  style={{ transform: 'translateX(-4rem)' }}
1179
1175
  />
1180
1176
  ) : dataset.ProductId ===
1181
- '8474c3b080fa42cc837f1d2338fcf096' ||
1182
- dataset.Product ===
1183
- 'High Resolution Snow and Ice Parameters' ? (
1177
+ '8474c3b080fa42cc837f1d2338fcf096' ? (
1184
1178
  <div class="zoom-in-message-container">
1185
1179
  <span>{dataset.DatasetTitle}</span>
1186
1180
  <div class="zoom-in-message">
@@ -218,6 +218,21 @@ const config = {
218
218
  'https://land.discomap.eea.europa.eu/arcgis/rest/services/CLMS_Portal/NUTS_2021_Improved/MapServer/',
219
219
  outsideEu:
220
220
  'https://land.discomap.eea.europa.eu/arcgis/rest/services/CLMS_Portal/World_countries_except_EU37/MapServer',
221
+ all_present_lc_a_pol:
222
+ 'https://clms-prod.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/dichotomous-reference-land-cover.png/@@images/image-800-8e5528b4247acef813af4b91d30a22d1.png',
223
+ all_present_lc_b_pol:
224
+ 'https://clmsdemo.devel6cph.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/modular-reference-land-cover.png/@@images/image-800-97f58b15239b2b3ea85d701e171eaf64.png',
225
+ all_lcc_a_pol:
226
+ 'https://clms-prod.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/dichotomous-land-cover-change.png/@@images/image-800-e77885afc5da8e0535f648b563e60408.png',
227
+ all_lcc_b_pol:
228
+ 'https://clms-prod.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/modular-land-cover-change.png/@@images/image-800-7e36e74d09ddd7e3f94fb502f0b5be8e.png',
229
+ cop_klc:
230
+ 'https://clms-prod.eea.europa.eu/en/products/lclcc-hot-spots/static-legends/key-landscapes-for-conservation-borders.png/@@images/image-800-28ced0e8616b9a414ea5076399a5ba4e.png',
231
+ klc_bbox: 'https://land.copernicus.eu/global/hsm/php/klc_bbox.php',
232
+ legendLinkUrl:
233
+ 'https://geospatial.jrc.ec.europa.eu/geoserver/hotspots/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=',
234
+ serviceUrl: 'https://geospatial.jrc.ec.europa.eu/geoserver/hotspots/wms',
235
+ all_geo_klc: 'https://land.copernicus.eu/global/hsm/all_geo_klc_json',
221
236
  },
222
237
  };
223
238
  export default config;