@eeacms/volto-arcgis-block 0.1.375 → 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 +4 -0
- package/package.json +1 -1
- package/src/components/MapViewer/AreaWidget.jsx +106 -58
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.377](https://github.com/eea/volto-arcgis-block/compare/0.1.376...0.1.377) - 30 July 2025
|
|
8
|
+
|
|
9
|
+
### [0.1.376](https://github.com/eea/volto-arcgis-block/compare/0.1.375...0.1.376) - 17 July 2025
|
|
10
|
+
|
|
7
11
|
### [0.1.375](https://github.com/eea/volto-arcgis-block/compare/0.1.374...0.1.375) - 14 July 2025
|
|
8
12
|
|
|
9
13
|
### [0.1.374](https://github.com/eea/volto-arcgis-block/compare/0.1.373...0.1.374) - 9 July 2025
|
package/package.json
CHANGED
|
@@ -155,6 +155,12 @@ class AreaWidget extends React.Component {
|
|
|
155
155
|
});
|
|
156
156
|
this.props.uploadFileHandler(true);
|
|
157
157
|
this.clearWidget();
|
|
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');
|
|
158
164
|
this.removeFileUploadedLayer();
|
|
159
165
|
this.container.current.querySelector(
|
|
160
166
|
'#download_area_select_nuts0',
|
|
@@ -234,6 +240,23 @@ class AreaWidget extends React.Component {
|
|
|
234
240
|
document.querySelector('.coordinateWindow').style.display = 'block';
|
|
235
241
|
} else {
|
|
236
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');
|
|
248
|
+
if (document.getElementById('menu-north')) {
|
|
249
|
+
document.getElementById('menu-north').value = null;
|
|
250
|
+
}
|
|
251
|
+
if (document.getElementById('menu-south')) {
|
|
252
|
+
document.getElementById('menu-south').value = null;
|
|
253
|
+
}
|
|
254
|
+
if (document.getElementById('menu-east')) {
|
|
255
|
+
document.getElementById('menu-east').value = null;
|
|
256
|
+
}
|
|
257
|
+
if (document.getElementById('menu-west')) {
|
|
258
|
+
document.getElementById('menu-west').value = null;
|
|
259
|
+
}
|
|
237
260
|
}
|
|
238
261
|
}
|
|
239
262
|
nuts0handler(e) {
|
|
@@ -996,78 +1019,93 @@ class AreaWidget extends React.Component {
|
|
|
996
1019
|
}
|
|
997
1020
|
addCoordinates() {
|
|
998
1021
|
this.clearWidget();
|
|
1022
|
+
let valid = true;
|
|
999
1023
|
let pointNorth = document.getElementById('menu-north');
|
|
1000
|
-
if (
|
|
1001
|
-
pointNorth.value
|
|
1002
|
-
|
|
1003
|
-
pointNorth.value
|
|
1024
|
+
if (
|
|
1025
|
+
pointNorth.value > 90 ||
|
|
1026
|
+
pointNorth.value < -90 ||
|
|
1027
|
+
pointNorth.value == null
|
|
1028
|
+
) {
|
|
1029
|
+
valid = false;
|
|
1004
1030
|
}
|
|
1005
1031
|
let pointSouth = document.getElementById('menu-south');
|
|
1006
|
-
if (
|
|
1007
|
-
pointSouth.value
|
|
1008
|
-
|
|
1009
|
-
pointSouth.value
|
|
1032
|
+
if (
|
|
1033
|
+
pointSouth.value > 90 ||
|
|
1034
|
+
pointSouth.value < -90 ||
|
|
1035
|
+
pointSouth.value == null
|
|
1036
|
+
) {
|
|
1037
|
+
valid = false;
|
|
1010
1038
|
}
|
|
1011
1039
|
let pointEast = document.getElementById('menu-east');
|
|
1012
|
-
if (
|
|
1013
|
-
pointEast.value
|
|
1014
|
-
|
|
1015
|
-
pointEast.value
|
|
1040
|
+
if (
|
|
1041
|
+
pointEast.value > 180 ||
|
|
1042
|
+
pointEast.value < -180 ||
|
|
1043
|
+
pointEast.value == null
|
|
1044
|
+
) {
|
|
1045
|
+
valid = false;
|
|
1016
1046
|
}
|
|
1017
1047
|
let pointWest = document.getElementById('menu-west');
|
|
1018
|
-
if (
|
|
1019
|
-
pointWest.value
|
|
1020
|
-
|
|
1021
|
-
pointWest.value
|
|
1048
|
+
if (
|
|
1049
|
+
pointWest.value > 180 ||
|
|
1050
|
+
pointWest.value < -180 ||
|
|
1051
|
+
pointWest.value == null
|
|
1052
|
+
) {
|
|
1053
|
+
valid = false;
|
|
1022
1054
|
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
let outSpatialReference = new SpatialReference({
|
|
1044
|
-
wkid: 102100,
|
|
1045
|
-
});
|
|
1046
|
-
let graphicProjection = projection.project(
|
|
1047
|
-
extentGraphic.geometry,
|
|
1048
|
-
outSpatialReference,
|
|
1049
|
-
);
|
|
1050
|
-
if (extentGraphic && this.checkExtent(graphicProjection)) {
|
|
1051
|
-
this.setState({
|
|
1052
|
-
showInfoPopup: true,
|
|
1053
|
-
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,
|
|
1054
1075
|
});
|
|
1055
|
-
|
|
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);
|
|
1056
1103
|
} else {
|
|
1057
1104
|
this.setState({
|
|
1058
1105
|
showInfoPopup: true,
|
|
1059
|
-
infoPopupType: '
|
|
1106
|
+
infoPopupType: 'invalidCoordinates',
|
|
1060
1107
|
});
|
|
1061
|
-
this.props.uploadFileHandler(true);
|
|
1062
1108
|
}
|
|
1063
|
-
this.props.updateArea({
|
|
1064
|
-
origin: {
|
|
1065
|
-
x: extentGraphic.geometry.xmin,
|
|
1066
|
-
y: extentGraphic.geometry.ymax,
|
|
1067
|
-
},
|
|
1068
|
-
end: { x: extentGraphic.geometry.xmax, y: extentGraphic.geometry.ymin },
|
|
1069
|
-
});
|
|
1070
|
-
this.props.view.graphics.add(extentGraphic);
|
|
1071
1109
|
}
|
|
1072
1110
|
openCoordinates(event) {
|
|
1073
1111
|
this.clearWidget();
|
|
@@ -1747,6 +1785,16 @@ class AreaWidget extends React.Component {
|
|
|
1747
1785
|
</div>
|
|
1748
1786
|
</>
|
|
1749
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
|
+
)}
|
|
1750
1798
|
</div>
|
|
1751
1799
|
</div>
|
|
1752
1800
|
</div>
|