@eeacms/volto-arcgis-block 0.1.247 → 0.1.249

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,10 @@ 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.249](https://github.com/eea/volto-arcgis-block/compare/0.1.248...0.1.249) - 15 January 2024
8
+
9
+ ### [0.1.248](https://github.com/eea/volto-arcgis-block/compare/0.1.247...0.1.248) - 12 January 2024
10
+
7
11
  ### [0.1.247](https://github.com/eea/volto-arcgis-block/compare/0.1.246...0.1.247) - 10 January 2024
8
12
 
9
13
  ### [0.1.246](https://github.com/eea/volto-arcgis-block/compare/0.1.245...0.1.246) - 10 January 2024
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.247",
3
+ "version": "0.1.249",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -162,8 +162,8 @@ class BookmarkWidget extends React.Component {
162
162
  check.forEach((layer) => {
163
163
  opacity.push(this.layers[layer].opacity);
164
164
  if (
165
- visibleLayers[check] &&
166
- visibleLayers[check][1] === 'eye-slash'
165
+ visibleLayers[layer] &&
166
+ visibleLayers[layer][1] === 'eye-slash'
167
167
  ) {
168
168
  visible.push(false);
169
169
  } else {
@@ -178,16 +178,22 @@ class BookmarkWidget extends React.Component {
178
178
  activeLayers: {},
179
179
  filteredLayers: {},
180
180
  };
181
- Object.keys(this.props.hotspotData.activeLayers).forEach((key) => {
182
- hotspotFilters.activeLayers[key] = null;
183
- });
184
- Object.keys(this.props.hotspotData.filteredLayers).forEach((key) => {
185
- hotspotFilters.filteredLayers[
186
- key
187
- ] = this.props.hotspotData.filteredLayers[
188
- key
189
- ].customLayerParameters['CQL_FILTER'];
190
- });
181
+ if (this.props.hotspotData && this.props.hotspotData.activeLayers) {
182
+ Object.keys(this.props.hotspotData.activeLayers).forEach((key) => {
183
+ hotspotFilters.activeLayers[key] = null;
184
+ });
185
+ }
186
+ if (this.props.hotspotData && this.props.hotspotData.filteredLayers) {
187
+ Object.keys(this.props.hotspotData.filteredLayers).forEach(
188
+ (key) => {
189
+ hotspotFilters.filteredLayers[
190
+ key
191
+ ] = this.props.hotspotData.filteredLayers[
192
+ key
193
+ ].customLayerParameters['CQL_FILTER'];
194
+ },
195
+ );
196
+ }
191
197
  this.sessionBookmarkHotspot.push(hotspotFilters);
192
198
  } else if (e.removed[0]) {
193
199
  for (let index = 0; index < this.sessionBookmarks.length; index++) {
@@ -255,7 +261,7 @@ class BookmarkWidget extends React.Component {
255
261
  let visible = [];
256
262
  check.forEach((layer) => {
257
263
  opacity.push(this.layers[layer].opacity);
258
- if (visibleLayers[check] && visibleLayers[check][1] === 'eye-slash') {
264
+ if (visibleLayers[layer] && visibleLayers[layer][1] === 'eye-slash') {
259
265
  visible.push(false);
260
266
  } else {
261
267
  visible.push(true);
@@ -265,16 +271,20 @@ class BookmarkWidget extends React.Component {
265
271
  activeLayers: {},
266
272
  filteredLayers: {},
267
273
  };
268
- Object.keys(this.props.hotspotData.activeLayers).forEach((key) => {
269
- hotspotFilters.activeLayers[key] = null;
270
- });
271
- Object.keys(this.props.hotspotData.filteredLayers).forEach((key) => {
272
- hotspotFilters.filteredLayers[
273
- key
274
- ] = this.props.hotspotData.filteredLayers[key].customLayerParameters[
275
- 'CQL_FILTER'
276
- ];
277
- });
274
+ if (this.props.hotspotData && this.props.hotspotData.activeLayers) {
275
+ Object.keys(this.props.hotspotData.activeLayers).forEach((key) => {
276
+ hotspotFilters.activeLayers[key] = null;
277
+ });
278
+ }
279
+ if (this.props.hotspotData && this.props.hotspotData.activeLayers) {
280
+ Object.keys(this.props.hotspotData.filteredLayers).forEach((key) => {
281
+ hotspotFilters.filteredLayers[
282
+ key
283
+ ] = this.props.hotspotData.filteredLayers[
284
+ key
285
+ ].customLayerParameters['CQL_FILTER'];
286
+ });
287
+ }
278
288
  for (let index = 0; index < this.sessionBookmarks.length; index++) {
279
289
  if (e.bookmark === this.sessionBookmarks[index]) {
280
290
  this.sessionBookmarks[index] = e.bookmark;
@@ -856,9 +856,12 @@ class HotspotWidget extends React.Component {
856
856
  this.getBBoxData();
857
857
  this.props.view.when(() => {
858
858
  this.props.view.map.layers.on('change', () => {
859
- let bookmarkHotspotFilter = JSON.parse(
860
- localStorage.getItem('bookmarkHotspotFilter'),
861
- );
859
+ let bookmarkHotspotFilter = null;
860
+ if (localStorage.getItem('bookmarkHotspotFilter')) {
861
+ bookmarkHotspotFilter = JSON.parse(
862
+ localStorage.getItem('bookmarkHotspotFilter'),
863
+ );
864
+ }
862
865
  if (
863
866
  bookmarkHotspotFilter !== null &&
864
867
  this.props.view.map.layers.items[0] !== 'bookmark'
@@ -465,8 +465,8 @@ class TimesliderWidget extends React.Component {
465
465
  document.querySelector(
466
466
  '.esri-ui-bottom-right.esri-ui-corner',
467
467
  ).style.pointerEvents = 'auto';
468
- this.drag.x = e.screenX - e.currentTarget.getBoundingClientRect().left;
469
- this.drag.y = e.screenY - e.currentTarget.getBoundingClientRect().top;
468
+ this.drag.x = e.screenX - e.currentTarget.getBoundingClientRect().right;
469
+ this.drag.y = e.screenY - e.currentTarget.getBoundingClientRect().bottom;
470
470
  }
471
471
 
472
472
  onDragOver(e) {
@@ -474,17 +474,17 @@ class TimesliderWidget extends React.Component {
474
474
  }
475
475
 
476
476
  onDrop(e) {
477
- let left =
478
- e.screenX -
477
+ let right =
479
478
  this.drag.x -
480
- e.currentTarget.getBoundingClientRect().left +
479
+ e.screenX +
480
+ e.currentTarget.getBoundingClientRect().right +
481
481
  'px';
482
- let top =
483
- e.screenY -
482
+ let bottom =
484
483
  this.drag.y -
485
- e.currentTarget.getBoundingClientRect().top +
484
+ e.screenY +
485
+ e.currentTarget.getBoundingClientRect().bottom +
486
486
  'px';
487
- this.setState({ styles: { left: left, top: top } });
487
+ this.setState({ styles: { right: right, bottom: bottom } });
488
488
  this.drag.frame.style.visibility = 'hidden';
489
489
  document.querySelector(
490
490
  '.esri-ui-bottom-right.esri-ui-corner',