@eeacms/volto-cca-policy 0.3.62 → 0.3.63

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,11 +4,13 @@ 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.3.62](https://github.com/eea/volto-cca-policy/compare/0.3.61...0.3.62) - 4 July 2025
7
+ ### [0.3.63](https://github.com/eea/volto-cca-policy/compare/0.3.62...0.3.63) - 9 July 2025
8
8
 
9
9
  #### :hammer_and_wrench: Others
10
10
 
11
- - Let's try again [Tiberiu Ichim - [`33edadf`](https://github.com/eea/volto-cca-policy/commit/33edadfcfaa23d294669fbe609bfa584673abf17)]
11
+ - Bring back geolocation widget [Tiberiu Ichim - [`7d388ac`](https://github.com/eea/volto-cca-policy/commit/7d388ac905688d67fd64a382d853afb562e593e2)]
12
+ ### [0.3.62](https://github.com/eea/volto-cca-policy/compare/0.3.61...0.3.62) - 4 July 2025
13
+
12
14
  ### [0.3.61](https://github.com/eea/volto-cca-policy/compare/0.3.60...0.3.61) - 4 July 2025
13
15
 
14
16
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.3.62",
3
+ "version": "0.3.63",
4
4
  "description": "@eeacms/volto-cca-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -1,4 +1,5 @@
1
- import { openlayers as ol } from '@eeacms/volto-openlayers-map';
1
+ import { withOpenLayers } from '@eeacms/volto-openlayers-map';
2
+ // import { openlayers as ol } from '@eeacms/volto-openlayers-map';
2
3
  import {
3
4
  Controls,
4
5
  Interactions,
@@ -9,7 +10,7 @@ import {
9
10
  import React, { useState } from 'react';
10
11
  import { useMapContext } from '@eeacms/volto-openlayers-map/hocs';
11
12
 
12
- function PinInteraction({ longitude, latitude, onChange }) {
13
+ function PinInteraction({ longitude, latitude, onChange, ol }) {
13
14
  const mapContext = useMapContext();
14
15
  const { addLayer, addInteraction, map } = mapContext;
15
16
 
@@ -63,13 +64,14 @@ function PinInteraction({ longitude, latitude, onChange }) {
63
64
  const [longitude, latitude] = lonLat;
64
65
  onChange({ latitude, longitude });
65
66
  });
66
- }, [addInteraction, addLayer, map, onChange, latitude, longitude]);
67
+ }, [addInteraction, addLayer, map, onChange, latitude, longitude, ol]);
67
68
 
68
69
  return null;
69
70
  }
70
71
 
71
72
  const TileSetLoader = (props) => {
72
73
  const [tileWMSSources, setTileWMSSources] = useState([]);
74
+ const { ol } = props;
73
75
 
74
76
  React.useEffect(() => {
75
77
  setTileWMSSources([
@@ -83,7 +85,7 @@ const TileSetLoader = (props) => {
83
85
  transition: 0,
84
86
  }),
85
87
  ]);
86
- }, []);
88
+ }, [ol]);
87
89
 
88
90
  return tileWMSSources ? (
89
91
  <MapContainer {...props} source={tileWMSSources[0]} />
@@ -91,7 +93,7 @@ const TileSetLoader = (props) => {
91
93
  };
92
94
 
93
95
  const MapContainer = (props) => {
94
- const { longitude, latitude, source, onChange } = props;
96
+ const { longitude, latitude, source, onChange, ol } = props;
95
97
  return (
96
98
  <Map
97
99
  view={{
@@ -105,6 +107,7 @@ const MapContainer = (props) => {
105
107
  <Layers>
106
108
  <Controls attribution={false} zoom={false} />
107
109
  <PinInteraction
110
+ ol={ol}
108
111
  latitude={latitude}
109
112
  longitude={longitude}
110
113
  onChange={onChange}
@@ -125,4 +128,4 @@ const MapContainer = (props) => {
125
128
  );
126
129
  };
127
130
 
128
- export default TileSetLoader;
131
+ export default withOpenLayers(TileSetLoader);
package/src/index.js CHANGED
@@ -43,7 +43,7 @@ import BrokenLinks from './components/theme/Views/BrokenLinks';
43
43
 
44
44
  import { eea_languages, non_eu_langs } from './constants';
45
45
 
46
- // import GeolocationWidget from './components/theme/Widgets/GeolocationWidget';
46
+ import GeolocationWidget from './components/theme/Widgets/GeolocationWidget';
47
47
  // import MigrationButtons from './components/MigrationButtons';
48
48
 
49
49
  const getEnv = () => (typeof window !== 'undefined' ? window.env : process.env);
@@ -430,7 +430,7 @@ const applyConfig = (config) => {
430
430
  };
431
431
  // Custom widgets
432
432
  config.widgets.id.geochars = GeocharsWidget;
433
- // config.widgets.id.geolocation = GeolocationWidget;
433
+ config.widgets.id.geolocation = GeolocationWidget;
434
434
  config.widgets.id.promotional_image = PromotionalImageWidget;
435
435
 
436
436
  if (config.widgets.views?.widget) {