@eeacms/volto-arcgis-block 0.1.274 → 0.1.275
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 +7 -1
- package/package.json +1 -1
- package/src/components/MapViewer/AreaWidget.jsx +24 -23
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,13 @@ 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.
|
|
7
|
+
### [0.1.275](https://github.com/eea/volto-arcgis-block/compare/0.1.274...0.1.275) - 19 April 2024
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- CLMS-3157 (feat): improve graphic color and transparency [Unai Bolivar - [`4f02a02`](https://github.com/eea/volto-arcgis-block/commit/4f02a02eda72f9b663e1694b79d003234bc71895)]
|
|
12
|
+
- CLMS-3157 (bug): committing current work on graphics. Incomplete ticket. [Unai Bolivar - [`45e7d04`](https://github.com/eea/volto-arcgis-block/commit/45e7d041aed301c28ed1f3ab23de6db61a1e17a8)]
|
|
13
|
+
### [0.1.274](https://github.com/eea/volto-arcgis-block/compare/0.1.273...0.1.274) - 12 April 2024
|
|
8
14
|
|
|
9
15
|
### [0.1.273](https://github.com/eea/volto-arcgis-block/compare/0.1.272...0.1.273) - 11 April 2024
|
|
10
16
|
|
package/package.json
CHANGED
|
@@ -367,19 +367,19 @@ class AreaWidget extends React.Component {
|
|
|
367
367
|
.then((response) => {
|
|
368
368
|
if (response.data && response.data.featureCollection) {
|
|
369
369
|
//Check for more than a single feature
|
|
370
|
-
|
|
371
|
-
|
|
370
|
+
let featureCollection = response.data.featureCollection;
|
|
371
|
+
if (this.checkFeatureCount(featureCollection) === false) return;
|
|
372
372
|
|
|
373
373
|
//Check that attributes and geometry are not null or undefined
|
|
374
374
|
if (
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
375
|
+
featureCollection.layers[0].featureSet.features[0].attributes ===
|
|
376
|
+
null ||
|
|
377
|
+
featureCollection.layers[0].featureSet.features[0].attributes ===
|
|
378
|
+
undefined ||
|
|
379
|
+
featureCollection.layers[0].featureSet.features[0].geometry ===
|
|
380
|
+
null ||
|
|
381
|
+
featureCollection.layers[0].featureSet.features[0].geometry ===
|
|
382
|
+
undefined
|
|
383
383
|
) {
|
|
384
384
|
this.setState({
|
|
385
385
|
showInfoPopup: true,
|
|
@@ -389,7 +389,7 @@ class AreaWidget extends React.Component {
|
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
//Create a feature layer from the feature collection
|
|
392
|
-
this.addFeatureCollectionToMap(
|
|
392
|
+
this.addFeatureCollectionToMap(featureCollection);
|
|
393
393
|
} else {
|
|
394
394
|
//console.error('Unexpected response structure:', response);
|
|
395
395
|
}
|
|
@@ -417,28 +417,29 @@ class AreaWidget extends React.Component {
|
|
|
417
417
|
// see the 'Feature Collection in Local Storage' sample for an example of how to work with local storage
|
|
418
418
|
addFeatureCollectionToMap(featureCollection) {
|
|
419
419
|
let sourceGraphics = [];
|
|
420
|
-
//const symbol = new SimpleFillSymbol({
|
|
421
|
-
// //type: 'simple-fill',
|
|
422
|
-
// color: [255, 255, 255, 0.5],
|
|
423
|
-
// outline: {
|
|
424
|
-
// color: [0, 0, 0],
|
|
425
|
-
// width: 1,
|
|
426
|
-
// },
|
|
427
|
-
//});
|
|
428
420
|
|
|
429
421
|
//Create a graphic for each feature in the feature collection
|
|
430
422
|
|
|
431
423
|
const layers = featureCollection.layers.map((layer) => {
|
|
432
424
|
const graphics = layer.featureSet.features.map((feature) => {
|
|
433
|
-
|
|
434
|
-
|
|
425
|
+
const polygonSymbol = {
|
|
426
|
+
type: 'simple-fill', // autocasts as new SimpleFillSymbol()
|
|
427
|
+
color: [234, 168, 72, 0.8],
|
|
428
|
+
outline: {
|
|
429
|
+
// autocasts as new SimpleLineSymbol()
|
|
430
|
+
color: '#000000',
|
|
431
|
+
width: 0.1,
|
|
432
|
+
},
|
|
433
|
+
};
|
|
434
|
+
let graphic = Graphic.fromJSON(feature);
|
|
435
|
+
graphic.symbol = polygonSymbol;
|
|
436
|
+
return graphic;
|
|
435
437
|
});
|
|
436
438
|
sourceGraphics = sourceGraphics.concat(graphics);
|
|
437
439
|
|
|
438
440
|
// Create a feature layer from the feature collection fields and gaphics
|
|
439
441
|
|
|
440
442
|
const featureLayer = new FeatureLayer({
|
|
441
|
-
// id: 9,
|
|
442
443
|
objectIdField: 'FID',
|
|
443
444
|
source: graphics,
|
|
444
445
|
legendEnabled: false,
|
|
@@ -1244,7 +1245,7 @@ class AreaWidget extends React.Component {
|
|
|
1244
1245
|
<FontAwesomeIcon icon={['fas', 'info-circle']} />
|
|
1245
1246
|
</span>
|
|
1246
1247
|
<div className="drawRectanglePopup-text">
|
|
1247
|
-
Invalid
|
|
1248
|
+
Invalid file format, or incomplete shapefile.
|
|
1248
1249
|
</div>
|
|
1249
1250
|
</>
|
|
1250
1251
|
)}
|