@eeacms/volto-arcgis-block 0.1.281 → 0.1.283

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,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.283](https://github.com/eea/volto-arcgis-block/compare/0.1.282...0.1.283) - 27 May 2024
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - CLMS-BUG-COUNTRIES-DOWNLOAD (bug): countries radio button for areas outside of europe fixed. removed a commented line [Unai Bolivar - [`6197c7d`](https://github.com/eea/volto-arcgis-block/commit/6197c7ddb80b7e796d3e9800e7c652f6839009bc)]
12
+ - CLMS-BUG-COUNTRIES-DOWNLOAD (bug): countries radio button for areas outside of europe fixed [Unai Bolivar - [`7a1dead`](https://github.com/eea/volto-arcgis-block/commit/7a1deada9c70158f24fd799385544b43f3ab76bf)]
13
+ ### [0.1.282](https://github.com/eea/volto-arcgis-block/compare/0.1.281...0.1.282) - 27 May 2024
14
+
7
15
  ### [0.1.281](https://github.com/eea/volto-arcgis-block/compare/0.1.280...0.1.281) - 21 May 2024
8
16
 
9
17
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.281",
3
+ "version": "0.1.283",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -184,6 +184,9 @@ class AreaWidget extends React.Component {
184
184
  this.container.current.querySelector('input:checked').click();
185
185
  }
186
186
  }
187
+ nutsRadioButtonGeneral(event) {
188
+ this.nutsRadioButton(event.target.value);
189
+ }
187
190
  nutsRadioButton(id) {
188
191
  if (id === 'nuts') {
189
192
  if (
@@ -832,55 +835,87 @@ class AreaWidget extends React.Component {
832
835
  document.querySelector('.esri-attribution__powered-by').style.display =
833
836
  'none';
834
837
  }
835
- areaSearch() {
836
- let searchText = document.querySelector('#area-searchtext').value;
837
- if (searchText.length === 2) {
838
- this.loadNutsService('nuts0', [0]);
839
- this.loadCountriesService('nuts0');
840
- document.getElementById('download_area_select_nuts0').checked = true;
841
- this.nutsRadioButton('nuts0');
842
- } else if (searchText.length === 3) {
843
- this.loadNutsService('nuts1', [1, 2]);
844
- document.getElementById('download_area_select_nuts1').checked = true;
845
- this.nutsRadioButton('nuts1');
846
- } else if (searchText.length === 4) {
847
- this.loadNutsService('nuts2', [3, 4, 5]);
848
- document.getElementById('download_area_select_nuts2').checked = true;
849
- this.nutsRadioButton('nuts2');
850
- } else if (searchText.length === 5) {
851
- this.loadNutsService('nuts3', [6, 7, 8]);
852
- document.getElementById('download_area_select_nuts3').checked = true;
853
- this.nutsRadioButton('nuts3');
854
- }
855
- let found = false;
856
- document.querySelector('.no-result-message').style.display = 'none';
857
- this.nutsGroupLayer.layers.items.forEach((item) => {
858
- item.queryFeatures().then((response) => {
859
- response.features.forEach((feature) => {
860
- if (feature.attributes.NUTS_ID === searchText) {
861
- found = true;
862
- let symbol = new SimpleFillSymbol(
863
- 'solid',
864
- new SimpleLineSymbol('solid', new Color([232, 104, 80]), 2),
865
- new Color([232, 104, 80, 0.25]),
866
- );
867
- let highlight = new Graphic(feature.geometry, symbol);
868
- this.props.view.graphics.removeAll();
869
- this.props.view.graphics.add(highlight);
870
- }
871
- });
872
- if (
873
- !found &&
874
- item ===
875
- this.nutsGroupLayer.layers.items[
876
- this.nutsGroupLayer.layers.items.length - 1
877
- ]
878
- ) {
879
- document.querySelector('.no-result-message').style.display = 'block';
880
- }
881
- });
882
- });
883
- }
838
+ // areaSearch() {
839
+ // let searchText = document.querySelector('#area-searchtext').value;
840
+ // if (searchText.length === 2) {
841
+ // this.loadNutsService('nuts0', [0]);
842
+ // this.loadCountriesService('nuts0');
843
+ // document.getElementById('download_area_select_nuts0').checked = true;
844
+ // this.nutsRadioButton('nuts0');
845
+ // } else if (searchText.length === 3) {
846
+ // this.loadNutsService('nuts1', [1, 2]);
847
+ // document.getElementById('download_area_select_nuts1').checked = true;
848
+ // this.nutsRadioButton('nuts1');
849
+ // } else if (searchText.length === 4) {
850
+ // this.loadNutsService('nuts2', [3, 4, 5]);
851
+ // document.getElementById('download_area_select_nuts2').checked = true;
852
+ // this.nutsRadioButton('nuts2');
853
+ // } else if (searchText.length === 5) {
854
+ // this.loadNutsService('nuts3', [6, 7, 8]);
855
+ // document.getElementById('download_area_select_nuts3').checked = true;
856
+ // this.nutsRadioButton('nuts3');
857
+ // }
858
+ // let found = false;
859
+ // let count = this.nutsGroupLayer.layers.items.length;
860
+ // const queryParams = this.nutsGroupLayer.layers.items[0].createQuery();
861
+ // // set a geometry for filtering features by a region of interest
862
+ // //queryParams.geometry = extentForRegionOfInterest;
863
+ // // Add to the layer's current definitionExpression
864
+ // // queryParams =
865
+ // // ({
866
+ // // geometry: point,
867
+ // // // distance and units will be null if basic query selected
868
+ // // distance: 0.5,
869
+ // // units: "miles",
870
+ // // spatialRelationship: "intersects",
871
+ // // returnGeometry: false,
872
+ // // outFields: ["*"],
873
+ // //})
874
+ // // queryParams.where = `(NUTS_ID = '${searchText}')`;//"NUTS_ID = "+ searchText;
875
+ // queryParams.outSpatialReference = this.props.view.spatialReference;
876
+
877
+ // // const query = new Query();
878
+ // // query.definitionExpression = "NUTS_ID = "+ searchText;
879
+ // // query.outSpatialReference = { wkid: 102100 };
880
+ // // query.returnGeometry = true;
881
+ // // query.outFields = [ "CITY_NAME" ];
882
+ // document.querySelector('.no-result-message').style.display = 'none';
883
+ // this.nutsGroupLayer.layers.items.forEach((item) => {
884
+ // count = count-1;
885
+ // item.queryFeatures(queryParams).then((response) => {
886
+ // response.features.forEach((feature) => {
887
+ // if (feature.attributes.NUTS_ID === searchText) {
888
+ // found = true;
889
+ // this.props.updateArea(feature);
890
+ // let symbol = new SimpleFillSymbol(
891
+ // 'solid',
892
+ // new SimpleLineSymbol('solid', new Color([232, 104, 80]), 2),
893
+ // new Color([232, 104, 80, 0.25]),
894
+ // );
895
+ // let highlight = new Graphic(feature.geometry, symbol);
896
+ // this.props.view.graphics.removeAll();
897
+ // this.props.view.graphics.add(highlight);
898
+ // this.setState({
899
+ // showInfoPopup: true,
900
+ // infoPopupType: 'download',
901
+ // });
902
+ // // if (this.props.download) {
903
+ // // document.querySelector(
904
+ // // '.drawRectanglePopup-block',
905
+ // // ).style.display = 'none';
906
+ // // }
907
+ // }
908
+ // });
909
+ // if (
910
+ // !found && count==0
911
+ // ) {
912
+ // document.querySelector('.no-result-message').style.display = 'block';
913
+ // } else if (found) {
914
+ // document.querySelector('.no-result-message').style.display = 'none';
915
+ // }
916
+ // });
917
+ // });
918
+ // }
884
919
 
885
920
  /**
886
921
  * This method is executed after the rener method is executed
@@ -1037,7 +1072,7 @@ class AreaWidget extends React.Component {
1037
1072
  <div className="right-panel-content">
1038
1073
  <div className="area-panel">
1039
1074
  <div className="area-header">Select by country or region</div>
1040
- <input
1075
+ {/* <input
1041
1076
  type="text"
1042
1077
  maxLength="6"
1043
1078
  id="area-searchtext"
@@ -1062,7 +1097,7 @@ class AreaWidget extends React.Component {
1062
1097
  >
1063
1098
  <span class="ccl-icon-zoom"></span>
1064
1099
  </button>
1065
- <div className="no-result-message">No result found</div>
1100
+ <div className="no-result-message">No result found</div> */}
1066
1101
  <div className="ccl-form">
1067
1102
  <fieldset className="ccl-fieldset">
1068
1103
  <div className="ccl-form-group">
@@ -1089,7 +1124,7 @@ class AreaWidget extends React.Component {
1089
1124
  name="downloadAreaSelect"
1090
1125
  value="nuts"
1091
1126
  className="ccl-checkbox cl-required ccl-form-check-input"
1092
- onClick={this.nutsRadioButton.bind(this)}
1127
+ onClick={this.nutsRadioButtonGeneral.bind(this)}
1093
1128
  ></input>
1094
1129
  <label
1095
1130
  className="ccl-form-radio-label"
@@ -51,7 +51,7 @@ export const AddCartItem = ({
51
51
  if (areaData) {
52
52
  area.type = 'nuts';
53
53
  if (areaData.geometry.type === 'polygon') {
54
- if ('countries'.includes(areaData.layer.id)) {
54
+ if (areaData.attributes.ISO_2DIGIT !== undefined) {
55
55
  area.value = areaData.attributes.ISO_2DIGIT;
56
56
  } else {
57
57
  area.value = areaData.attributes.NUTS_ID;