@eeacms/volto-arcgis-block 0.1.206 → 0.1.208

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,14 @@ 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.208](https://github.com/eea/volto-arcgis-block/compare/0.1.207...0.1.208) - 2 October 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - info widget bug when activate/deactivate LLC layer fixed [masanchez85 - [`6cb51a9`](https://github.com/eea/volto-arcgis-block/commit/6cb51a9739718817bc81c860c95c93aeec5f708b)]
12
+ - CLMS-2349, BBOX fixing and text to hyperlink adaptation [masanchez85 - [`7d8dfa2`](https://github.com/eea/volto-arcgis-block/commit/7d8dfa2e0fdd036dad132ef53494314a13fcca9e)]
13
+ ### [0.1.207](https://github.com/eea/volto-arcgis-block/compare/0.1.206...0.1.207) - 27 September 2023
14
+
7
15
  ### [0.1.206](https://github.com/eea/volto-arcgis-block/compare/0.1.205...0.1.206) - 26 September 2023
8
16
 
9
17
  ### [0.1.205](https://github.com/eea/volto-arcgis-block/compare/0.1.204...0.1.205) - 25 September 2023
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.206",
3
+ "version": "0.1.208",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -192,6 +192,25 @@ class AreaWidget extends React.Component {
192
192
  });
193
193
  return index;
194
194
  }
195
+
196
+ checkExtent(extent) {
197
+ let extentToCHeck = new Extent({
198
+ xmin: -4957196.074387185,
199
+ xmax: 8896862.428240843,
200
+ ymin: 2252343.9407090154,
201
+ ymax: 12114555.078173038,
202
+ spatialReference: { wkid: 102100 },
203
+ });
204
+ if (
205
+ extent.xmin < extentToCHeck.xmin &&
206
+ extent.xmax > extentToCHeck.xmax &&
207
+ extent.ymin < extentToCHeck.ymin &&
208
+ extent.ymax > extentToCHeck.ymax
209
+ )
210
+ return true;
211
+ else return false;
212
+ }
213
+
195
214
  rectanglehandler() {
196
215
  this.clearWidget();
197
216
  window.document.querySelector('.pan-container').style.display = 'flex';
@@ -212,10 +231,17 @@ class AreaWidget extends React.Component {
212
231
  if (e.action === 'start') {
213
232
  if (extentGraphic) this.props.view.graphics.remove(extentGraphic);
214
233
  origin = this.props.view.toMap(e);
215
- this.setState({
216
- showInfoPopup: true,
217
- infoPopupType: 'download',
218
- });
234
+ if (extentGraphic && this.checkExtent(extentGraphic.geometry)) {
235
+ this.setState({
236
+ showInfoPopup: true,
237
+ infoPopupType: 'fullDataset',
238
+ });
239
+ } else {
240
+ this.setState({
241
+ showInfoPopup: true,
242
+ infoPopupType: 'download',
243
+ });
244
+ }
219
245
  if (this.props.download) {
220
246
  document.querySelector('.drawRectanglePopup-block').style.display =
221
247
  'none';
@@ -233,6 +259,17 @@ class AreaWidget extends React.Component {
233
259
  }),
234
260
  symbol: fillSymbol,
235
261
  });
262
+ if (extentGraphic && this.checkExtent(extentGraphic.geometry)) {
263
+ this.setState({
264
+ showInfoPopup: true,
265
+ infoPopupType: 'fullDataset',
266
+ });
267
+ } else {
268
+ this.setState({
269
+ showInfoPopup: true,
270
+ infoPopupType: 'download',
271
+ });
272
+ }
236
273
  this.props.updateArea({
237
274
  origin: { x: origin.longitude, y: origin.latitude },
238
275
  end: { x: p.longitude, y: p.latitude },
@@ -530,6 +567,26 @@ class AreaWidget extends React.Component {
530
567
  </div>
531
568
  </>
532
569
  )}
570
+ {this.state.infoPopupType === 'fullDataset' && (
571
+ <>
572
+ <span className="drawRectanglePopup-icon">
573
+ <FontAwesomeIcon icon={['fas', 'info-circle']} />
574
+ </span>
575
+ <div className="drawRectanglePopupWarning-text">
576
+ <a
577
+ style={{ color: 'black', cursor: 'pointer' }}
578
+ className="drawRectanglePopupWarning"
579
+ id="drawRectanglePopupWarning"
580
+ href="https://clmsdemo.devel6cph.eea.europa.eu/en/how-to-guides/how-to-download-spatial-data/how-to-download-m2m"
581
+ target="_blank"
582
+ rel="noreferrer"
583
+ >
584
+ To download the full dataset consult the "How to
585
+ download M2M" How to guide.
586
+ </a>
587
+ </div>
588
+ </>
589
+ )}
533
590
  </div>
534
591
  </div>
535
592
  </div>
@@ -817,6 +817,7 @@ class HotspotWidget extends React.Component {
817
817
  componentWillUnmount() {
818
818
  // Remove the event listener when the component is unmounted
819
819
  window.removeEventListener('storage', this.handleStorageChange);
820
+ //sessionStorage.removeItem("hotspotFilterApplied");
820
821
  }
821
822
 
822
823
  handleStorageChange = () => {
@@ -919,6 +919,7 @@ class InfoWidget extends React.Component {
919
919
  render() {
920
920
  let noData = true;
921
921
  if (this.state.pixelInfo) {
922
+ /* debugger */
922
923
  noData = this.infoData[this.state.layerIndex].data.data
923
924
  ? this.infoData[this.state.layerIndex].data.data.values.map((a) => {
924
925
  return a[
@@ -927,6 +928,7 @@ class InfoWidget extends React.Component {
927
928
  }).length === 0
928
929
  : true;
929
930
  } else if (this.state.popup) {
931
+ /* debugger */
930
932
  noData = this.infoData[this.state.layerIndex].data.length === 0 && true;
931
933
  }
932
934
  return (
@@ -125,21 +125,27 @@ export const AddCartItem = ({
125
125
  (isLoggedIn ? ' logged' : '')
126
126
  }
127
127
  onClick={(e) => {
128
- if (!areaData) {
129
- if (
130
- !mapViewer.activeWidget ||
131
- !mapViewer.activeWidget.container.current.classList.contains(
132
- 'area-container',
133
- )
134
- ) {
135
- document.querySelector('#map_area_button').click();
128
+ if (
129
+ !document.getElementsByClassName(
130
+ 'drawRectanglePopupWarning-text',
131
+ ).length > 0
132
+ ) {
133
+ if (!areaData) {
134
+ if (
135
+ !mapViewer.activeWidget ||
136
+ !mapViewer.activeWidget.container.current.classList.contains(
137
+ 'area-container',
138
+ )
139
+ ) {
140
+ document.querySelector('#map_area_button').click();
141
+ }
142
+ } else {
143
+ checkArea(e);
136
144
  }
137
- } else {
138
- checkArea(e);
139
145
  }
140
146
  }}
141
147
  onKeyDown={(e) => {
142
- if (!areaData) {
148
+ /* if (!areaData) {
143
149
  if (
144
150
  !mapViewer.activeWidget ||
145
151
  !mapViewer.activeWidget.container.current.classList.contains(
@@ -150,16 +156,26 @@ export const AddCartItem = ({
150
156
  }
151
157
  } else {
152
158
  checkArea(e);
153
- }
159
+ } */
154
160
  }}
155
161
  tabIndex="0"
156
162
  role="button"
157
163
  >
158
164
  <FontAwesomeIcon
159
- className={isLoggedIn ? '' : ' locked'}
165
+ className={
166
+ isLoggedIn &&
167
+ !document.getElementsByClassName(
168
+ 'drawRectanglePopupWarning-text',
169
+ ).length > 0
170
+ ? ''
171
+ : ' locked'
172
+ }
160
173
  icon={['fas', 'download']}
161
174
  />
162
- {!isLoggedIn && <FontAwesomeIcon icon={['fas', 'lock']} />}
175
+ {!isLoggedIn ||
176
+ (document.getElementsByClassName(
177
+ 'drawRectanglePopupWarning-text',
178
+ ).length > 0 && <FontAwesomeIcon icon={['fas', 'lock']} />)}
163
179
  </span>
164
180
  }
165
181
  content="Download"
@@ -2833,16 +2849,15 @@ class MenuWidget extends React.Component {
2833
2849
  layers.push(layer);
2834
2850
  }
2835
2851
  });
2852
+ if (layers.length === 0 && document.querySelector('.info-container')) {
2853
+ document.querySelector('.info-container').style.display = 'none';
2854
+ } else if (layers.length > 0) {
2855
+ document.querySelector('.info-container').style.display = 'flex';
2856
+ }
2836
2857
  if (!sessionStorage.getItem('hotspotFilterApplied')) {
2837
- if (layers.length === 0 && document.querySelector('.info-container')) {
2838
- this.props.mapViewer.closeActiveWidget();
2839
- document.querySelector('.info-container').style.display = 'none';
2840
- } else if (layers.length > 0) {
2841
- document.querySelector('.info-container').style.display = 'flex';
2842
- }
2858
+ this.props.mapViewer.closeActiveWidget();
2843
2859
  }
2844
2860
  this.renderHotspot();
2845
- /**/
2846
2861
  }
2847
2862
 
2848
2863
  getLayerTitle(layer) {