@eeacms/volto-arcgis-block 0.1.165 → 0.1.167

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,15 @@ 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.167](https://github.com/eea/volto-arcgis-block/compare/0.1.166...0.1.167) - 5 July 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - LINT [manuelmartinezbilbomatica - [`0fd14f1`](https://github.com/eea/volto-arcgis-block/commit/0fd14f153088c272884939c73d7fc5b535ccf764)]
12
+ - LINT [manuelmartinezbilbomatica - [`725d36c`](https://github.com/eea/volto-arcgis-block/commit/725d36cce3fd03e0eecc5302f94d24a331096af7)]
13
+ - FIX: Full Extent to whole dataset working from Custom Mapviewer and General Mapviewer [manuelmartinezbilbomatica - [`0d90358`](https://github.com/eea/volto-arcgis-block/commit/0d903585e0b37311da39f5b80516ce5145801393)]
14
+ ### [0.1.166](https://github.com/eea/volto-arcgis-block/compare/0.1.165...0.1.166) - 4 July 2023
15
+
7
16
  ### [0.1.165](https://github.com/eea/volto-arcgis-block/compare/0.1.164...0.1.165) - 4 July 2023
8
17
 
9
18
  #### :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.165",
3
+ "version": "0.1.167",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -296,7 +296,12 @@ class AreaWidget extends React.Component {
296
296
  if (graphic) {
297
297
  let geometry = graphic.geometry;
298
298
  if (geometry.type === 'polygon') {
299
- let nuts = graphic.attributes.NUTS_ID;
299
+ let nuts;
300
+ if ('countries'.includes(graphic.layer.id)) {
301
+ nuts = graphic.attributes.ISO_2DIGIT;
302
+ } else {
303
+ nuts = graphic.attributes.NUTS_ID;
304
+ }
300
305
  this.props.updateArea(nuts);
301
306
  let symbol = new SimpleFillSymbol(
302
307
  'solid',
@@ -1669,11 +1669,11 @@ class MenuWidget extends React.Component {
1669
1669
  if (this.props.download || this.location.search !== '') {
1670
1670
  if (
1671
1671
  this.extentInitiated === false &&
1672
- productContainerId !== 'd764e020485a402598551fa461bf1db2' //hotspot
1672
+ productContainerId !== 'd764e020485a402598551fa461bf1db2' // hotspot
1673
1673
  ) {
1674
1674
  this.extentInitiated = true;
1675
1675
  setTimeout(() => {
1676
- this.fullExtent(elem);
1676
+ this.FullExtentDataset(elem);
1677
1677
  }, 2000);
1678
1678
  }
1679
1679
  }
@@ -2260,6 +2260,27 @@ class MenuWidget extends React.Component {
2260
2260
  })
2261
2261
  .catch(() => {});
2262
2262
  };
2263
+
2264
+ async FullExtentDataset(elem) {
2265
+ let BBoxes = {};
2266
+ this.findCheckedDataset(elem);
2267
+ if (this.url.toLowerCase().includes('wms')) {
2268
+ await this.getCapabilities(this.url, 'wms');
2269
+ BBoxes = this.parseBBOXWMS(this.xml);
2270
+ } else if (this.url.toLowerCase().includes('wmts')) {
2271
+ await this.getCapabilities(this.url, 'wmts');
2272
+ BBoxes = this.parseBBOXWMTS(this.xml);
2273
+ }
2274
+ let myExtent = new Extent({
2275
+ xmin: BBoxes['dataset'].xmin,
2276
+ ymin: BBoxes['dataset'].ymin,
2277
+ xmax: BBoxes['dataset'].xmax,
2278
+ ymax: BBoxes['dataset'].ymax,
2279
+ // spatialReference: 4326 // by default wkid 4326
2280
+ });
2281
+ this.view.goTo(myExtent); //
2282
+ }
2283
+
2263
2284
  async fullExtent(elem) {
2264
2285
  this.findCheckedDataset(elem);
2265
2286
  let BBoxes = {};
@@ -2294,7 +2315,6 @@ class MenuWidget extends React.Component {
2294
2315
  BBoxes = this.parseBBOXWMS(this.xml);
2295
2316
  } else if (this.url.toLowerCase().includes('wmts')) {
2296
2317
  await this.getCapabilities(this.url, 'wmts');
2297
-
2298
2318
  BBoxes = this.parseBBOXWMTS(this.xml);
2299
2319
  }
2300
2320
  if (
@@ -2308,11 +2328,8 @@ class MenuWidget extends React.Component {
2308
2328
  !this.productId.includes('333e4100b79045daa0ff16466ac83b7f') &&
2309
2329
  this.location.search !== ''
2310
2330
  ) {
2311
- // firstLayer = BBoxes['dataset'];
2312
2331
  firstLayer = BBoxes.dataset;
2313
2332
  } else if (this.productId.includes('130299ac96e54c30a12edd575eff80f7')) {
2314
- //corine land cover
2315
- //
2316
2333
  if (elem.title.includes('LAEA')) {
2317
2334
  firstLayer = BBoxes['dataset'];
2318
2335
  } else if (elem.title.includes('Guadeloupe')) {
@@ -2326,7 +2343,6 @@ class MenuWidget extends React.Component {
2326
2343
  } else if (elem.title.includes('Reunion')) {
2327
2344
  firstLayer = BBoxes[Object.keys(BBoxes)[4]];
2328
2345
  } else {
2329
- // firstLayer = BBoxes[Object.keys(BBoxes)[Object.keys(BBoxes).length - 1]];
2330
2346
  firstLayer = BBoxes['dataset'];
2331
2347
  }
2332
2348
  } else if (
@@ -2339,7 +2355,6 @@ class MenuWidget extends React.Component {
2339
2355
  } else {
2340
2356
  // Takes the BBOX corresponding to the layer.
2341
2357
  firstLayer = BBoxes[elem.attributes.layerid.value];
2342
- // firstLayer = BBoxes[Object.keys(BBoxes)[0]];
2343
2358
  }
2344
2359
 
2345
2360
  let myExtent = new Extent({