@eeacms/volto-arcgis-block 0.1.195 → 0.1.196

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.196](https://github.com/eea/volto-arcgis-block/compare/0.1.195...0.1.196) - 14 September 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Lint [masanchez85 - [`c6d79ad`](https://github.com/eea/volto-arcgis-block/commit/c6d79ad1b6d19cb5a43112f9ced774519b441c8c)]
12
+ - CLMS-2279, 1952 [masanchez85 - [`e5b42da`](https://github.com/eea/volto-arcgis-block/commit/e5b42daca404a70aa327018db260b59fcd37fb21)]
7
13
  ### [0.1.195](https://github.com/eea/volto-arcgis-block/compare/0.1.194...0.1.195) - 14 September 2023
8
14
 
9
15
  #### :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.195",
3
+ "version": "0.1.196",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -300,6 +300,8 @@ class MenuWidget extends React.Component {
300
300
  });
301
301
  }
302
302
  }
303
+ if (!this.visibleLayers) this.visibleLayers = {};
304
+ this.handleRasterVectorLegend();
303
305
  }
304
306
  });
305
307
 
@@ -1635,6 +1637,31 @@ class MenuWidget extends React.Component {
1635
1637
  this.setState({});
1636
1638
  }
1637
1639
 
1640
+ /**
1641
+ * Method to show/hide a legend if the layer is active or not in the view
1642
+ */
1643
+ handleRasterVectorLegend() {
1644
+ let zoom = this.view.get('zoom');
1645
+ Object.keys(this.activeLayersJSON).forEach((key) => {
1646
+ let activeLayer = this.activeLayersJSON[key];
1647
+ let layerTitle = activeLayer.props.children[0].props.children;
1648
+ if (layerTitle.includes('raster')) {
1649
+ if (zoom > 6) {
1650
+ this.layers[key].visible = false;
1651
+ } else {
1652
+ this.layers[key].visible = true;
1653
+ }
1654
+ } else if (layerTitle.includes('vector')) {
1655
+ if (zoom >= 12) {
1656
+ this.layers[key].visible = true;
1657
+ } else {
1658
+ this.layers[key].visible = false;
1659
+ }
1660
+ }
1661
+ this.setState({});
1662
+ });
1663
+ }
1664
+
1638
1665
  async toggleLayer(elem) {
1639
1666
  if (!this.visibleLayers) this.visibleLayers = {};
1640
1667
  if (!this.timeLayers) this.timeLayers = {};
@@ -1694,6 +1721,7 @@ class MenuWidget extends React.Component {
1694
1721
  elem,
1695
1722
  Object.keys(this.activeLayersJSON).length,
1696
1723
  );
1724
+ this.handleRasterVectorLegend();
1697
1725
  } else {
1698
1726
  this.activeLayersJSON[elem.id] = this.addActiveLayer(
1699
1727
  elem,
@@ -192,11 +192,14 @@ class TimesliderWidget extends React.Component {
192
192
  */
193
193
  async componentDidMount() {
194
194
  await this.loader();
195
+ let playRateValue =
196
+ this.layer.ProductId === '8474c3b080fa42cc837f1d2338fcf096' ? 4000 : 1000;
195
197
  this.TimesliderWidget = new TimeSlider({
196
198
  view: this.props.view,
197
199
  container: document.querySelector('.timeslider-panel'),
198
200
  timeVisible: true,
199
201
  mode: 'instant',
202
+ playRate: playRateValue,
200
203
  loop: false,
201
204
  labelFormatFunction: (value, type, element, layout) => {
202
205
  if (!this.TimesliderWidget.fullTimeExtent) {