@eeacms/volto-arcgis-block 0.1.141 → 0.1.143

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,25 @@ 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.143](https://github.com/eea/volto-arcgis-block/compare/0.1.142...0.1.143) - 15 May 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Lint [martinman - [`5b1c048`](https://github.com/eea/volto-arcgis-block/commit/5b1c04899fe2ccdde306c77a9f5f27d1aceb8ea3)]
12
+ - FEAT: Logo not displayed [martinman - [`d10dfd0`](https://github.com/eea/volto-arcgis-block/commit/d10dfd04430e4da7df2cb6a21618cfef46442fd0)]
13
+ - Commit [martinman - [`25f511d`](https://github.com/eea/volto-arcgis-block/commit/25f511d6506dc6e78f48261f748b977452e9d08e)]
14
+ - No natural basemap [martinman - [`aa9c9ca`](https://github.com/eea/volto-arcgis-block/commit/aa9c9ca82527d251031740a316f719a9f2057bae)]
15
+ - FEAT: Natural Earth with labels basemap added [martinman - [`8879146`](https://github.com/eea/volto-arcgis-block/commit/8879146804b5b7f5e499c16501e596353126823f)]
16
+ - FEAT: Limits fixed. Next step basemap layer [martinman - [`7830627`](https://github.com/eea/volto-arcgis-block/commit/783062798e1e2339942e17614fdd290e448753e5)]
17
+ - Commit [martinman - [`be26cd1`](https://github.com/eea/volto-arcgis-block/commit/be26cd14d8d8004dc83134f0a10e21936de57b61)]
18
+ - FEAT: Extent limit when zoom min out. Rotation disabled. Next step logo and fit optimal extent [martinman - [`a6828e3`](https://github.com/eea/volto-arcgis-block/commit/a6828e32e219aad91f463ea8cbb3ab23b53e97a5)]
19
+ - FEAT: Extent limit when zoom min out. Rotation disabled. Next step logo and fit optimal extent [martinman - [`1c1f9cd`](https://github.com/eea/volto-arcgis-block/commit/1c1f9cd5d0f44e739e10fd738f8bf297a9a2b309)]
20
+ - First commit [martinman - [`80d20de`](https://github.com/eea/volto-arcgis-block/commit/80d20de2625a542f03b5ba117d1bd65b2987b4a8)]
21
+ ### [0.1.142](https://github.com/eea/volto-arcgis-block/compare/0.1.141...0.1.142) - 12 May 2023
22
+
23
+ #### :hammer_and_wrench: Others
24
+
25
+ - CLMS-1953 (fix): set legend image opacity to 1 regardless of layer view opacity [ujbolivar - [`0adad47`](https://github.com/eea/volto-arcgis-block/commit/0adad4733f487213ddbb90513e3d217c1d87c951)]
7
26
  ### [0.1.141](https://github.com/eea/volto-arcgis-block/compare/0.1.140...0.1.141) - 11 May 2023
8
27
 
9
28
  ### [0.1.140](https://github.com/eea/volto-arcgis-block/compare/0.1.139...0.1.140) - 11 May 2023
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.141",
3
+ "version": "0.1.143",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -242,7 +242,6 @@ class BasemapWidget extends React.Component {
242
242
  ],
243
243
  });
244
244
  }
245
-
246
245
  this.props.view.ui.add(this.container.current, 'top-right');
247
246
  }
248
247
  /**
@@ -18,7 +18,7 @@ import InfoWidget from './InfoWidget';
18
18
  import MenuWidget from './MenuWidget';
19
19
  import HotspotWidget from './HotspotWidget';
20
20
  //import "isomorphic-fetch"; <-- Necessary to use fetch?
21
- var Map, MapView, Zoom, intl, Basemap, WebTileLayer;
21
+ var Map, MapView, Zoom, intl, Basemap, WebTileLayer, Extent;
22
22
  let mapStatus = {};
23
23
  const CheckLanguage = () => {
24
24
  const { locale } = useIntl();
@@ -86,16 +86,20 @@ class MapViewer extends React.Component {
86
86
  'esri/intl',
87
87
  'esri/Basemap',
88
88
  'esri/layers/WebTileLayer',
89
- ]).then(([_Map, _MapView, _Zoom, _intl, _Basemap, _WebTileLayer]) => {
90
- [Map, MapView, Zoom, intl, Basemap, WebTileLayer] = [
91
- _Map,
92
- _MapView,
93
- _Zoom,
94
- _intl,
95
- _Basemap,
96
- _WebTileLayer,
97
- ];
98
- });
89
+ 'esri/geometry/Extent',
90
+ ]).then(
91
+ ([_Map, _MapView, _Zoom, _intl, _Basemap, _WebTileLayer, _Extent]) => {
92
+ [Map, MapView, Zoom, intl, Basemap, WebTileLayer, Extent] = [
93
+ _Map,
94
+ _MapView,
95
+ _Zoom,
96
+ _intl,
97
+ _Basemap,
98
+ _WebTileLayer,
99
+ _Extent,
100
+ ];
101
+ },
102
+ );
99
103
  }
100
104
 
101
105
  /**
@@ -136,6 +140,7 @@ class MapViewer extends React.Component {
136
140
  this.map = new Map({
137
141
  // basemap: 'topo',
138
142
  basemap: this.positronCompositeBasemap,
143
+ logo: false,
139
144
  });
140
145
 
141
146
  mapStatus = this.recoverState();
@@ -162,6 +167,8 @@ class MapViewer extends React.Component {
162
167
  constraints: {
163
168
  minZoom: this.mapCfg.minZoom,
164
169
  maxZoom: this.mapCfg.maxZoom,
170
+ rotationEnabled: false,
171
+ geometry: this.mapCfg.geometry,
165
172
  },
166
173
  ui: {
167
174
  components: ['attribution'],
@@ -179,8 +186,27 @@ class MapViewer extends React.Component {
179
186
  this.setCenterState(newValue);
180
187
  });
181
188
 
189
+ let constraintExtent = null;
182
190
  this.view.watch('zoom', (newValue, oldValue, property, object) => {
183
191
  this.setZoomState(newValue);
192
+ if (mapStatus.zoom <= this.mapCfg.minZoom) {
193
+ constraintExtent = new Extent({
194
+ xmin: -90,
195
+ ymin: -45,
196
+ xmax: 90,
197
+ ymax: 45,
198
+ spatialReference: 4326,
199
+ });
200
+ } else {
201
+ constraintExtent = new Extent({
202
+ xmin: -90,
203
+ ymin: -85,
204
+ xmax: 90,
205
+ ymax: 85,
206
+ spatialReference: 4326,
207
+ });
208
+ }
209
+ this.view.constraints.geometry = constraintExtent;
184
210
  });
185
211
  this.view.popup.autoOpenEnabled = false;
186
212
  // After launching the MapViewerConfig action
@@ -193,6 +219,7 @@ class MapViewer extends React.Component {
193
219
  //we invoke the setState method, that changes the state and forces a
194
220
  //react component to render itself again
195
221
  //this.setState({});
222
+ this.view.ui._removeComponents(['attribution']);
196
223
  });
197
224
  }
198
225
 
@@ -1963,7 +1963,7 @@ class MenuWidget extends React.Component {
1963
1963
  product.Datasets.forEach((dataset) => {
1964
1964
  if (dataset.DatasetTitle.includes(selectedDataset.title)) {
1965
1965
  this.url = dataset.ViewService;
1966
- this.productTitle = product.ProductTitle;
1966
+ this.productId = product.ProductId;
1967
1967
  }
1968
1968
  });
1969
1969
  });
@@ -2108,12 +2108,12 @@ class MenuWidget extends React.Component {
2108
2108
  this.findCheckedDataset(elem);
2109
2109
  let BBoxes = {};
2110
2110
  let firstLayer;
2111
- if (this.productTitle.includes('Global Dynamic Land Cover')) {
2111
+ if (this.productId.includes('333e4100b79045daa0ff16466ac83b7f')) {
2112
2112
  this.findDatasetBoundingBox(elem);
2113
2113
  BBoxes = this.parseBBOXJSON(this.dataBBox);
2114
2114
  } else if (
2115
- this.productTitle.includes('Low Resolution Vegetation Parameters') ||
2116
- this.productTitle.includes('Water Parameters')
2115
+ this.productId.includes('fe8209dffe13454891cea05998c8e456') ||
2116
+ this.productId.includes('8914fde2241a4035818af8f0264fd55e')
2117
2117
  ) {
2118
2118
  if (
2119
2119
  this.layers[elem.id].fullExtents &&
@@ -2143,7 +2143,7 @@ class MenuWidget extends React.Component {
2143
2143
  BBoxes[Object.keys(BBoxes)[0]] &&
2144
2144
  BBoxes[Object.keys(BBoxes)[0]] !== null
2145
2145
  ) {
2146
- if (elem.title.includes('Corine Land Cover')) {
2146
+ if (this.productId.includes('130299ac96e54c30a12edd575eff80f7')) {
2147
2147
  if (elem.title.includes('Guadeloupe')) {
2148
2148
  firstLayer = BBoxes[Object.keys(BBoxes)[0]];
2149
2149
  } else if (elem.title.includes('French Guiana')) {
@@ -2682,6 +2682,30 @@ class MenuWidget extends React.Component {
2682
2682
  '.active-layer[layer-id="' + layer + '"] .active-layer-opacity',
2683
2683
  ).dataset.opacity = value;
2684
2684
  // }
2685
+ setTimeout(() => {
2686
+ this.setLegendOpacity();
2687
+ }, 100);
2688
+ }
2689
+
2690
+ setLegendOpacity() {
2691
+ const collection = document.getElementsByClassName('esri-legend__symbol');
2692
+
2693
+ Array.prototype.forEach.call(collection, function (element) {
2694
+ let img = {};
2695
+
2696
+ if (element.hasChildNodes()) {
2697
+ img = element.childNodes[0];
2698
+ } else {
2699
+ img = element;
2700
+ }
2701
+ // Set Legend opacity back to 1;
2702
+ if (img) {
2703
+ img.setAttribute(
2704
+ 'style',
2705
+ 'opacity:1; -moz-opacity:1; filter:alpha(opacity=100)',
2706
+ );
2707
+ }
2708
+ });
2685
2709
  }
2686
2710
 
2687
2711
  /**
@@ -2792,7 +2816,7 @@ class MenuWidget extends React.Component {
2792
2816
  this.saveLayerOrder();
2793
2817
  this.checkInfoWidget();
2794
2818
  this.setState({});
2795
- if (this.productTitle.includes('Global Dynamic Land Cover')) {
2819
+ if (this.productId.includes('333e4100b79045daa0ff16466ac83b7f')) {
2796
2820
  if (this.visibleLayers[elem.id][1] === 'eye-slash') {
2797
2821
  this.map.findLayerById(elem.id).visible = false;
2798
2822
  } else {
@@ -5,6 +5,13 @@ const config = {
5
5
  zoom: 3,
6
6
  minZoom: 2,
7
7
  maxZoom: 20,
8
+ geometry: {
9
+ type: 'extent',
10
+ xmin: -90,
11
+ ymin: -45,
12
+ xmax: 90,
13
+ ymax: 45,
14
+ },
8
15
  activeLayers: [],
9
16
  },
10
17
  Components: [