@eeacms/volto-arcgis-block 0.1.171 → 0.1.172

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,12 @@ 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.172](https://github.com/eea/volto-arcgis-block/compare/0.1.171...0.1.172) - 17 July 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - 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)]
12
+ ### [0.1.171](https://github.com/eea/volto-arcgis-block/compare/0.1.170...0.1.171) - 17 July 2023
8
13
 
9
14
  ### [0.1.170](https://github.com/eea/volto-arcgis-block/compare/0.1.169...0.1.170) - 13 July 2023
10
15
 
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.172",
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
  }
@@ -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;