@eeacms/volto-arcgis-block 0.1.224 → 0.1.226

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,10 @@ 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.226](https://github.com/eea/volto-arcgis-block/compare/0.1.225...0.1.226) - 27 October 2023
8
+
9
+ ### [0.1.225](https://github.com/eea/volto-arcgis-block/compare/0.1.224...0.1.225) - 26 October 2023
10
+
7
11
  ### [0.1.224](https://github.com/eea/volto-arcgis-block/compare/0.1.223...0.1.224) - 25 October 2023
8
12
 
9
13
  ### [0.1.223](https://github.com/eea/volto-arcgis-block/compare/0.1.222...0.1.223) - 25 October 2023
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.224",
3
+ "version": "0.1.226",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -32,7 +32,8 @@ class AreaWidget extends React.Component {
32
32
  'esri-icon-cursor-marquee esri-widget--button esri-widget esri-interactive';
33
33
  // Enable defaultPopup option to charge popup and highlifght feature
34
34
  this.props.mapViewer.view.popup.defaultPopupTemplateEnabled = true;
35
- this.nutsUrl = '';
35
+ this.nutsUrl =
36
+ 'https://land.discomap.eea.europa.eu/arcgis/rest/services/CLMS_Portal/NUTS_2021_Improved/MapServer/0/query?f=json&text=&objectIds=&time=&timeRelation=esriTimeRelationOverlaps&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=*&returnGeometry=false&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&historicMoment=&returnDistinctValues=false&resultOffset=&resultRecordCount=&returnExtentOnly=false&sqlFormat=none&datumTransformation=&parameterValues=&rangeValues=&quantizationParameters=&featureEncoding=esriDefault&';
36
37
  this.initFMI = this.initFMI.bind(this);
37
38
  }
38
39
 
@@ -824,14 +824,16 @@ class HotspotWidget extends React.Component {
824
824
  this.props.view.ui.add(this.container.current, 'top-right');
825
825
  this.layerModelInit();
826
826
  this.getBBoxData();
827
- this.props.view.map.layers.on('change', () => {
828
- this.setState({
829
- activeLayersArray: Array.from(
830
- document.querySelectorAll('.active-layer'),
831
- ),
827
+ this.props.view.when(() => {
828
+ this.props.view.map.layers.on('change', () => {
829
+ this.setState({
830
+ activeLayersArray: Array.from(
831
+ document.querySelectorAll('.active-layer'),
832
+ ),
833
+ });
834
+ const newHotspotData = this.props.hotspotData;
835
+ this.props.hotspotDataHandler(newHotspotData);
832
836
  });
833
- const newHotspotData = this.props.hotspotData;
834
- this.props.hotspotDataHandler(newHotspotData);
835
837
  });
836
838
  }
837
839
 
@@ -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';
@@ -227,10 +227,10 @@ class LegendWidget extends React.Component {
227
227
  if (prevState.loading !== this.state.loading) {
228
228
  if (this.state.loading === true) {
229
229
  setTimeout(() => {
230
- this.brokenLegendImagePatch();
231
230
  if (this.props.download) {
232
231
  this.hideNutsLegend();
233
232
  }
233
+ this.brokenLegendImagePatch();
234
234
  this.setState({ loading: false });
235
235
  }, 2000);
236
236
  }
@@ -648,8 +648,10 @@ class MenuWidget extends React.Component {
648
648
  loadCss();
649
649
  await this.loader();
650
650
  await this.getTMSLayersJSON();
651
- this.prepareHotspotLayers();
652
- this.getHotspotLayerIds();
651
+ if (!this.props.download) {
652
+ this.prepareHotspotLayers();
653
+ this.getHotspotLayerIds();
654
+ }
653
655
  this.props.view.ui.add(this.container.current, 'top-left');
654
656
  if (this.props.download) {
655
657
  setTimeout(() => {
@@ -1897,7 +1899,7 @@ class MenuWidget extends React.Component {
1897
1899
  this.deleteFilteredLayer(elem.id);
1898
1900
  let mapLayer = this.map.findLayerById(elem.id);
1899
1901
  if (mapLayer) {
1900
- mapLayer.clear();
1902
+ if (mapLayer.type && mapLayer.type !== 'base-tile') mapLayer.clear();
1901
1903
  mapLayer.destroy();
1902
1904
  this.map.remove(this.layers[elem.id]);
1903
1905
  }
@@ -1915,7 +1917,9 @@ class MenuWidget extends React.Component {
1915
1917
  ) {
1916
1918
  this.toggleCustomLegendItem(this.layers[elem.id]);
1917
1919
  }
1918
- this.activeLayersToHotspotData(elem.id);
1920
+ if (!this.props.download) {
1921
+ this.activeLayersToHotspotData(elem.id);
1922
+ }
1919
1923
  }
1920
1924
 
1921
1925
  getHotspotLayerIds() {
@@ -2595,7 +2599,9 @@ class MenuWidget extends React.Component {
2595
2599
  firstLayer = BBoxes['all_present_lc_a_pol'];
2596
2600
  } else {
2597
2601
  // Takes the BBOX corresponding to the layer.
2598
- firstLayer = BBoxes[elem.attributes.layerid.value];
2602
+ if (this.productId.includes('333e4100b79045daa0ff16466ac83b7f')) {
2603
+ firstLayer = BBoxes[0];
2604
+ } else firstLayer = BBoxes[elem.attributes.layerid.value];
2599
2605
  }
2600
2606
 
2601
2607
  let myExtent = new Extent({