@eeacms/volto-arcgis-block 0.1.320 → 0.1.321

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.321](https://github.com/eea/volto-arcgis-block/compare/0.1.320...0.1.321) - 9 December 2024
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - CLMS-3264 (bug): Downloading map image layer datasets functions correctly. [Unai Bolivar - [`e11271c`](https://github.com/eea/volto-arcgis-block/commit/e11271c7ec621231207ca3069b6470f814eea7e2)]
12
+ - CLMS-3264 (bug): pointing to correct db. Resetting local host to run tests. Saving before hand. [Unai Bolivar - [`3dca534`](https://github.com/eea/volto-arcgis-block/commit/3dca5348668b69b7fa65b39371d28e4111e0b2e8)]
7
13
  ### [0.1.320](https://github.com/eea/volto-arcgis-block/compare/0.1.319...0.1.320) - 9 December 2024
8
14
 
9
15
  ### [0.1.319](https://github.com/eea/volto-arcgis-block/compare/0.1.318...0.1.319) - 2 December 2024
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.320",
3
+ "version": "0.1.321",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -15,7 +15,8 @@ var WMSLayer,
15
15
  Extent,
16
16
  MapImageLayer,
17
17
  projection,
18
- SpatialReference;
18
+ SpatialReference,
19
+ WebMercatorUtils;
19
20
 
20
21
  const popupSettings = {
21
22
  basic: true,
@@ -91,6 +92,9 @@ export const AddCartItem = ({
91
92
  let areaExtent = null;
92
93
  let check = document.querySelector('.area-panel input:checked')?.value;
93
94
  let fileUpload = sessionStorage.getItem('fileUploadLayer') ? true : false;
95
+ let isMapServer = dataset.ViewService.toLowerCase().endsWith('/mapserver')
96
+ ? true
97
+ : false;
94
98
  if (check === 'area' || fileUpload) {
95
99
  areaExtent = new Extent({
96
100
  xmin: Math.min(areaData.end.x, areaData.origin.x),
@@ -98,6 +102,13 @@ export const AddCartItem = ({
98
102
  ymin: Math.min(areaData.end.y, areaData.origin.y),
99
103
  ymax: Math.max(areaData.end.y, areaData.origin.y),
100
104
  });
105
+ } else if (isMapServer) {
106
+ areaExtent = new Extent({
107
+ xmin: areaData.geometry.extent.xmin,
108
+ ymin: areaData.geometry.extent.ymin,
109
+ xmax: areaData.geometry.extent.xmax,
110
+ ymax: areaData.geometry.extent.ymax,
111
+ });
101
112
  } else {
102
113
  areaExtent = areaData.geometry;
103
114
  }
@@ -133,7 +144,14 @@ export const AddCartItem = ({
133
144
  ymax: 20037508.342789,
134
145
  });
135
146
  }
136
- if (layerExtent.intersects(areaExtent)) {
147
+ if ((check === 'area' || fileUpload) && isMapServer) {
148
+ const transformedLayerExtent = WebMercatorUtils.webMercatorToGeographic(
149
+ layerExtent,
150
+ );
151
+ if (transformedLayerExtent.intersects(areaExtent)) {
152
+ intersection = true;
153
+ }
154
+ } else if (layerExtent.intersects(areaExtent)) {
137
155
  intersection = true;
138
156
  }
139
157
  }
@@ -475,6 +493,7 @@ class MenuWidget extends React.Component {
475
493
  'esri/layers/MapImageLayer',
476
494
  'esri/geometry/projection',
477
495
  'esri/geometry/SpatialReference',
496
+ 'esri/geometry/support/webMercatorUtils',
478
497
  ]).then(
479
498
  ([
480
499
  _WMSLayer,
@@ -486,6 +505,7 @@ class MenuWidget extends React.Component {
486
505
  _MapImageLayer,
487
506
  _projection,
488
507
  _SpatialReference,
508
+ _WebMercatorUtils,
489
509
  ]) => {
490
510
  [
491
511
  WMSLayer,
@@ -497,6 +517,7 @@ class MenuWidget extends React.Component {
497
517
  MapImageLayer,
498
518
  projection,
499
519
  SpatialReference,
520
+ WebMercatorUtils,
500
521
  ] = [
501
522
  _WMSLayer,
502
523
  _WMTSLayer,
@@ -507,6 +528,7 @@ class MenuWidget extends React.Component {
507
528
  _MapImageLayer,
508
529
  _projection,
509
530
  _SpatialReference,
531
+ _WebMercatorUtils,
510
532
  ];
511
533
  },
512
534
  );