@eeacms/volto-arcgis-block 0.1.376 → 0.1.377

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,8 @@ 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.377](https://github.com/eea/volto-arcgis-block/compare/0.1.376...0.1.377) - 30 July 2025
8
+
7
9
  ### [0.1.376](https://github.com/eea/volto-arcgis-block/compare/0.1.375...0.1.376) - 17 July 2025
8
10
 
9
11
  ### [0.1.375](https://github.com/eea/volto-arcgis-block/compare/0.1.374...0.1.375) - 14 July 2025
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.376",
3
+ "version": "0.1.377",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -156,6 +156,11 @@ class AreaWidget extends React.Component {
156
156
  this.props.uploadFileHandler(true);
157
157
  this.clearWidget();
158
158
  document.querySelector('.coordinateWindow').style.display = 'none';
159
+ document.querySelector('.coordinateContainer').style.display = 'block';
160
+ document.querySelector('.coordinateWindow').style.height = '13rem';
161
+ document
162
+ .querySelector('.closeCoordinates')
163
+ .classList.replace('esri-icon-up-arrow', 'esri-icon-close');
159
164
  this.removeFileUploadedLayer();
160
165
  this.container.current.querySelector(
161
166
  '#download_area_select_nuts0',
@@ -235,6 +240,11 @@ class AreaWidget extends React.Component {
235
240
  document.querySelector('.coordinateWindow').style.display = 'block';
236
241
  } else {
237
242
  document.querySelector('.coordinateWindow').style.display = 'none';
243
+ document.querySelector('.coordinateContainer').style.display = 'block';
244
+ document.querySelector('.coordinateWindow').style.height = '13rem';
245
+ document
246
+ .querySelector('.closeCoordinates')
247
+ .classList.replace('esri-icon-up-arrow', 'esri-icon-close');
238
248
  if (document.getElementById('menu-north')) {
239
249
  document.getElementById('menu-north').value = null;
240
250
  }
@@ -1009,79 +1019,93 @@ class AreaWidget extends React.Component {
1009
1019
  }
1010
1020
  addCoordinates() {
1011
1021
  this.clearWidget();
1022
+ let valid = true;
1012
1023
  let pointNorth = document.getElementById('menu-north');
1013
- if (pointNorth.value > 90) {
1014
- pointNorth.value = 90;
1015
- } else if (pointNorth.value < -90) {
1016
- pointNorth.value = -90;
1024
+ if (
1025
+ pointNorth.value > 90 ||
1026
+ pointNorth.value < -90 ||
1027
+ pointNorth.value == null
1028
+ ) {
1029
+ valid = false;
1017
1030
  }
1018
1031
  let pointSouth = document.getElementById('menu-south');
1019
- if (pointSouth.value > 90) {
1020
- pointSouth.value = 90;
1021
- } else if (pointSouth.value < -90) {
1022
- pointSouth.value = -90;
1032
+ if (
1033
+ pointSouth.value > 90 ||
1034
+ pointSouth.value < -90 ||
1035
+ pointSouth.value == null
1036
+ ) {
1037
+ valid = false;
1023
1038
  }
1024
1039
  let pointEast = document.getElementById('menu-east');
1025
- if (pointEast.value > 180) {
1026
- pointEast.value = 180;
1027
- } else if (pointEast.value < -180) {
1028
- pointEast.value = -180;
1040
+ if (
1041
+ pointEast.value > 180 ||
1042
+ pointEast.value < -180 ||
1043
+ pointEast.value == null
1044
+ ) {
1045
+ valid = false;
1029
1046
  }
1030
1047
  let pointWest = document.getElementById('menu-west');
1031
- if (pointWest.value > 180) {
1032
- pointWest.value = 180;
1033
- } else if (pointWest.value < -180) {
1034
- pointWest.value = -180;
1048
+ if (
1049
+ pointWest.value > 180 ||
1050
+ pointWest.value < -180 ||
1051
+ pointWest.value == null
1052
+ ) {
1053
+ valid = false;
1035
1054
  }
1036
- let pointNW = [pointNorth.value, pointWest.value];
1037
- let pointSE = [pointSouth.value, pointEast.value];
1038
- var fillSymbol = {
1039
- type: 'simple-fill',
1040
- color: [255, 255, 255, 0.5],
1041
- outline: {
1042
- color: [0, 0, 0],
1043
- width: 1,
1044
- },
1045
- };
1046
- let extentGraphic = new Graphic({
1047
- geometry: new Extent({
1048
- xmin: Math.min(pointNW[1], pointSE[1]),
1049
- xmax: Math.max(pointNW[1], pointSE[1]),
1050
- ymin: Math.min(pointNW[0], pointSE[0]),
1051
- ymax: Math.max(pointNW[0], pointSE[0]),
1052
- spatialReference: { wkid: 4326 },
1053
- }),
1054
- symbol: fillSymbol,
1055
- });
1056
- let outSpatialReference = new SpatialReference({
1057
- wkid: 102100,
1058
- });
1059
- let graphicProjection = projection.project(
1060
- extentGraphic.geometry,
1061
- outSpatialReference,
1062
- );
1063
- if (extentGraphic && this.checkExtent(graphicProjection)) {
1064
- this.setState({
1065
- showInfoPopup: true,
1066
- infoPopupType: 'fullDataset',
1055
+ if (valid) {
1056
+ let pointNW = [pointNorth.value, pointWest.value];
1057
+ let pointSE = [pointSouth.value, pointEast.value];
1058
+ var fillSymbol = {
1059
+ type: 'simple-fill',
1060
+ color: [255, 255, 255, 0.5],
1061
+ outline: {
1062
+ color: [0, 0, 0],
1063
+ width: 1,
1064
+ },
1065
+ };
1066
+ let extentGraphic = new Graphic({
1067
+ geometry: new Extent({
1068
+ xmin: Math.min(pointNW[1], pointSE[1]),
1069
+ xmax: Math.max(pointNW[1], pointSE[1]),
1070
+ ymin: Math.min(pointNW[0], pointSE[0]),
1071
+ ymax: Math.max(pointNW[0], pointSE[0]),
1072
+ spatialReference: { wkid: 4326 },
1073
+ }),
1074
+ symbol: fillSymbol,
1067
1075
  });
1068
- this.props.uploadFileHandler(true);
1076
+ let outSpatialReference = new SpatialReference({
1077
+ wkid: 102100,
1078
+ });
1079
+ let graphicProjection = projection.project(
1080
+ extentGraphic.geometry,
1081
+ outSpatialReference,
1082
+ );
1083
+ if (this.checkExtent(graphicProjection)) {
1084
+ this.setState({
1085
+ showInfoPopup: true,
1086
+ infoPopupType: 'fullDataset',
1087
+ });
1088
+ } else {
1089
+ this.setState({
1090
+ showInfoPopup: true,
1091
+ infoPopupType: 'download',
1092
+ });
1093
+ this.closeCoordinates();
1094
+ }
1095
+ this.props.updateArea({
1096
+ origin: {
1097
+ x: extentGraphic.geometry.xmin,
1098
+ y: extentGraphic.geometry.ymax,
1099
+ },
1100
+ end: { x: extentGraphic.geometry.xmax, y: extentGraphic.geometry.ymin },
1101
+ });
1102
+ this.props.view.graphics.add(extentGraphic);
1069
1103
  } else {
1070
1104
  this.setState({
1071
1105
  showInfoPopup: true,
1072
- infoPopupType: 'download',
1106
+ infoPopupType: 'invalidCoordinates',
1073
1107
  });
1074
- this.props.uploadFileHandler(true);
1075
- this.closeCoordinates();
1076
1108
  }
1077
- this.props.updateArea({
1078
- origin: {
1079
- x: extentGraphic.geometry.xmin,
1080
- y: extentGraphic.geometry.ymax,
1081
- },
1082
- end: { x: extentGraphic.geometry.xmax, y: extentGraphic.geometry.ymin },
1083
- });
1084
- this.props.view.graphics.add(extentGraphic);
1085
1109
  }
1086
1110
  openCoordinates(event) {
1087
1111
  this.clearWidget();
@@ -1761,6 +1785,16 @@ class AreaWidget extends React.Component {
1761
1785
  </div>
1762
1786
  </>
1763
1787
  )}
1788
+ {this.state.infoPopupType === 'invalidCoordinates' && (
1789
+ <>
1790
+ <span className="drawRectanglePopup-icon">
1791
+ <FontAwesomeIcon icon={['fas', 'info-circle']} />
1792
+ </span>
1793
+ <div className="drawRectanglePopup-text">
1794
+ Invalid coordinates.
1795
+ </div>
1796
+ </>
1797
+ )}
1764
1798
  </div>
1765
1799
  </div>
1766
1800
  </div>