@eeacms/volto-arcgis-block 0.1.304 → 0.1.305

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,7 +4,9 @@ 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.304](https://github.com/eea/volto-arcgis-block/compare/0.1.303...0.1.304) - 13 September 2024
7
+ ### [0.1.305](https://github.com/eea/volto-arcgis-block/compare/0.1.304...0.1.305) - 7 October 2024
8
+
9
+ ### [0.1.304](https://github.com/eea/volto-arcgis-block/compare/0.1.303...0.1.304) - 16 September 2024
8
10
 
9
11
  ### [0.1.303](https://github.com/eea/volto-arcgis-block/compare/0.1.302...0.1.303) - 10 September 2024
10
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.304",
3
+ "version": "0.1.305",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -86,10 +86,19 @@ class InfoWidget extends React.Component {
86
86
  this.props.mapViewer.view.popup.close();
87
87
  }
88
88
  }
89
+
90
+ waitForContainer(mapdiv) {
91
+ while (mapdiv === null) {
92
+ new Promise((resolve) => setTimeout(resolve, 100)); // wait for 100ms
93
+ }
94
+ return mapdiv;
95
+ }
96
+
89
97
  /**
90
98
  * This method is executed after the rener method is executed
91
99
  */ async componentDidMount() {
92
100
  await this.loader();
101
+ this.waitForContainer(this.container.current);
93
102
  this.props.view.ui.add(this.container.current, 'top-right');
94
103
  this.props.view.on('click', (e) => {
95
104
  let screenPoint = {
@@ -53,7 +53,15 @@ class LoadingSpinner extends React.Component {
53
53
  this.setState({});
54
54
  }
55
55
 
56
+ waitForContainer(mapdiv) {
57
+ while (mapdiv === null) {
58
+ new Promise((resolve) => setTimeout(resolve, 100)); // wait for 100ms
59
+ }
60
+ return mapdiv;
61
+ }
62
+
56
63
  async componentDidMount() {
64
+ this.waitForContainer(this.props.view);
57
65
  this.props.view.when(() => {
58
66
  this.props.view.ui.add(this.container.current, 'manual');
59
67
  this.listenForLayerChanges();
@@ -792,6 +792,13 @@ class MenuWidget extends React.Component {
792
792
  }, 1000);
793
793
  }
794
794
 
795
+ waitForContainer(mapdiv) {
796
+ while (mapdiv === null) {
797
+ new Promise((resolve) => setTimeout(resolve, 100)); // wait for 100ms
798
+ }
799
+ return mapdiv;
800
+ }
801
+
795
802
  /**
796
803
  * This method is executed after the render method is executed
797
804
  */
@@ -804,6 +811,7 @@ class MenuWidget extends React.Component {
804
811
  // currentContainer = await this.container.current;
805
812
  //} while (currentContainer == null);
806
813
  if (!this.props.download) {
814
+ this.waitForContainer(this.container.current);
807
815
  this.prepareHotspotLayers();
808
816
  this.getHotspotLayerIds();
809
817
  this.props.view.ui.add(this.container.current, 'top-left');
@@ -66,12 +66,22 @@ class PrintWidget extends React.Component {
66
66
  this.setState({ showMapMenu: true });
67
67
  }
68
68
  }
69
+
70
+ waitForContainer(mapdiv) {
71
+ while (mapdiv === null) {
72
+ new Promise((resolve) => setTimeout(resolve, 100)); // wait for 100ms
73
+ }
74
+ return mapdiv;
75
+ }
76
+
69
77
  /**
70
78
  * This method is executed after the rener method is executed
71
79
  */
72
80
  async componentDidMount() {
73
81
  await this.loader();
82
+ this.waitForContainer(this.container.current);
74
83
  this.props.view.ui.add(this.container.current, 'top-right');
84
+ this.waitForContainer(this.container.current.querySelector('.print-panel'));
75
85
  this.print = new Print({
76
86
  view: this.props.view,
77
87
  container: this.container.current.querySelector('.print-panel'),
@@ -26,11 +26,19 @@ class ScaleWidget extends React.Component {
26
26
  });
27
27
  }
28
28
 
29
+ waitForContainer(mapdiv) {
30
+ while (mapdiv === null) {
31
+ new Promise((resolve) => setTimeout(resolve, 100)); // wait for 100ms
32
+ }
33
+ return mapdiv;
34
+ }
35
+
29
36
  /**
30
37
  * This method is executed after the rener method is executed
31
38
  */
32
39
  async componentDidMount() {
33
40
  await this.loader();
41
+ this.waitForContainer(this.props.view);
34
42
  this.scaleBar = new ScaleBar({
35
43
  view: this.props.view,
36
44
  unit: 'dual',