@eeacms/volto-arcgis-block 0.1.268 → 0.1.269
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,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.269](https://github.com/eea/volto-arcgis-block/compare/0.1.268...0.1.269) - 21 March 2024
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- CLMS-2383-3050 (bug): commented unused var [Unai Bolivar - [`a8e696b`](https://github.com/eea/volto-arcgis-block/commit/a8e696bdf0252c3a8401c822e1b2bf56246dafba)]
|
|
12
|
+
- CLMS-2383-3050 (bug): implemented file upload form cache cleaning, disabled geojson process, centered NUTS icon [Unai Bolivar - [`84c5677`](https://github.com/eea/volto-arcgis-block/commit/84c5677ef8af6568151ae2a9ce1dd0eaff966466)]
|
|
7
13
|
### [0.1.268](https://github.com/eea/volto-arcgis-block/compare/0.1.267...0.1.268) - 21 March 2024
|
|
8
14
|
|
|
9
15
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -265,14 +265,17 @@ class AreaWidget extends React.Component {
|
|
|
265
265
|
//console.log('uploaded file from form: ', file);
|
|
266
266
|
|
|
267
267
|
//List allowed file extensions
|
|
268
|
-
|
|
268
|
+
|
|
269
|
+
//let fileExtensions = ['zip', 'geojson'];
|
|
269
270
|
|
|
270
271
|
// Get the file extension
|
|
271
272
|
let fileExtension = fileName.split('.').pop();
|
|
272
273
|
|
|
273
274
|
//console.log('file extension: ', fileExtension);
|
|
274
275
|
//Check if the file format is not supported
|
|
275
|
-
|
|
276
|
+
|
|
277
|
+
// if (fileExtensions.indexOf(fileExtension) === -1) {
|
|
278
|
+
if (fileExtension !== 'zip') {
|
|
276
279
|
this.setState({
|
|
277
280
|
showInfoPopup: true,
|
|
278
281
|
infoPopupType: 'fileFormat',
|
|
@@ -282,13 +285,14 @@ class AreaWidget extends React.Component {
|
|
|
282
285
|
|
|
283
286
|
// Check if the file is a geojson or CSV and the file size is over the 10mb file size limit
|
|
284
287
|
// or file is a shape file and the file size is over the 2mb file size limit
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
288
|
+
|
|
289
|
+
//if (fileSize > 10485760 && fileExtension === 'geojson') {
|
|
290
|
+
// this.setState({
|
|
291
|
+
// showInfoPopup: true,
|
|
292
|
+
// infoPopupType: 'fileLimit',
|
|
293
|
+
// });
|
|
294
|
+
// return;
|
|
295
|
+
//}
|
|
292
296
|
|
|
293
297
|
if (fileSize > 2097152 && fileExtension === 'zip') {
|
|
294
298
|
this.setState({
|
|
@@ -301,12 +305,11 @@ class AreaWidget extends React.Component {
|
|
|
301
305
|
switch (fileExtension) {
|
|
302
306
|
case 'zip':
|
|
303
307
|
this.generateFeatureCollection(fileName, file, 'shapefile');
|
|
304
|
-
//reader.readAsArrayBuffer(file);
|
|
305
|
-
break;
|
|
306
|
-
case 'geojson':
|
|
307
|
-
this.generateFeatureCollection(fileName, file, 'geojson');
|
|
308
|
-
//reader.readAsText(file);
|
|
309
308
|
break;
|
|
309
|
+
//case 'geojson':
|
|
310
|
+
// this.generateFeatureCollection(fileName, file, 'geojson');
|
|
311
|
+
// //reader.readAsText(file);
|
|
312
|
+
// break;
|
|
310
313
|
//case 'csv':
|
|
311
314
|
//this.generateFeatureCollection(
|
|
312
315
|
// fileName,
|
|
@@ -318,6 +321,9 @@ class AreaWidget extends React.Component {
|
|
|
318
321
|
default:
|
|
319
322
|
break;
|
|
320
323
|
}
|
|
324
|
+
setTimeout(() => {
|
|
325
|
+
e.target.value = null;
|
|
326
|
+
}, 2000);
|
|
321
327
|
};
|
|
322
328
|
|
|
323
329
|
generateFeatureCollection(fileName, file, inputFormat) {
|
|
@@ -372,37 +378,6 @@ class AreaWidget extends React.Component {
|
|
|
372
378
|
//console.error('Failed to generate feature collection:', error);
|
|
373
379
|
});
|
|
374
380
|
}
|
|
375
|
-
|
|
376
|
-
loadFileUploadService(data) {
|
|
377
|
-
//debugger;
|
|
378
|
-
document.querySelector('.esri-attribution__powered-by').style.display =
|
|
379
|
-
'flex';
|
|
380
|
-
const blob = new Blob([data], {
|
|
381
|
-
type: 'json',
|
|
382
|
-
});
|
|
383
|
-
const url = URL.createObjectURL(blob);
|
|
384
|
-
|
|
385
|
-
var layer = new FeatureLayer({
|
|
386
|
-
id: 9,
|
|
387
|
-
//url: this.props.urls.outsideEu,
|
|
388
|
-
url: url,
|
|
389
|
-
layerId: 9,
|
|
390
|
-
outFields: ['*'],
|
|
391
|
-
popupEnabled: false,
|
|
392
|
-
title: 'upload',
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
//this.removeFileUploadedLayer();
|
|
396
|
-
|
|
397
|
-
this.removeNutsLayers();
|
|
398
|
-
|
|
399
|
-
this.nutsGroupLayer.add(layer);
|
|
400
|
-
|
|
401
|
-
let index = this.getHighestIndex();
|
|
402
|
-
|
|
403
|
-
this.props.map.reorder(this.nutsGroupLayer, index + 1);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
381
|
// add the feature collection to the map and zoom to the feature collection extent
|
|
407
382
|
// if you want to persist the feature collection when you reload browser, you could store the
|
|
408
383
|
// collection in local storage by serializing the layer using featureLayer.toJson()
|
|
@@ -473,7 +448,7 @@ class AreaWidget extends React.Component {
|
|
|
473
448
|
});
|
|
474
449
|
//Check for the correct spatial reference
|
|
475
450
|
//console.log('layer: ', layers);
|
|
476
|
-
if (this.checkWkid(layers[0]?.spatialReference) === false) return;
|
|
451
|
+
//if (this.checkWkid(layers[0]?.spatialReference) === false) return;
|
|
477
452
|
|
|
478
453
|
let geometry = new Extent(
|
|
479
454
|
featureCollection.layers[0].layerDefinition.extent,
|
|
@@ -1113,7 +1088,7 @@ class AreaWidget extends React.Component {
|
|
|
1113
1088
|
>
|
|
1114
1089
|
<div className="field">
|
|
1115
1090
|
<label className="file-upload">
|
|
1116
|
-
<span>File formats supported: shp(zip)
|
|
1091
|
+
<span>File formats supported: shp(zip)</span>
|
|
1117
1092
|
<input
|
|
1118
1093
|
type="file"
|
|
1119
1094
|
name="file"
|
|
@@ -349,8 +349,14 @@ div.esri-popover
|
|
|
349
349
|
margin-left: 2rem;
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
+
div.area-container .ccl-form .ccl-form-check-input + .ccl-form-radio-label {
|
|
353
|
+
display: flex;
|
|
354
|
+
justify-content: space-between;
|
|
355
|
+
padding-left: 1.75rem;
|
|
356
|
+
}
|
|
357
|
+
|
|
352
358
|
label.ccl-form-radio-label span.nuts-menu-icon {
|
|
353
|
-
|
|
359
|
+
max-width: 30px;
|
|
354
360
|
}
|
|
355
361
|
|
|
356
362
|
.area-container .esri-button {
|