@eeacms/volto-eea-map 0.1.28 → 0.1.30
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/.coverage.babel.config.js +1 -1
- package/CHANGELOG.md +11 -1
- package/jest-addon.config.js +2 -4
- package/package.json +4 -6
- package/src/components/ExtraViews.jsx +1 -1
- package/src/components/Webmap.jsx +42 -35
- package/src/components/widgets/LayerSelectWidget.jsx +29 -1
- package/src/components/widgets/LegendWidget.jsx +1 -1
- package/src/styles/map.css +10 -0
|
@@ -2,7 +2,7 @@ const defaultBabel = require('@plone/volto/babel');
|
|
|
2
2
|
|
|
3
3
|
function applyDefault(api) {
|
|
4
4
|
const voltoBabel = defaultBabel(api);
|
|
5
|
-
voltoBabel.plugins.push('
|
|
5
|
+
voltoBabel.plugins.push('istanbul');
|
|
6
6
|
return voltoBabel;
|
|
7
7
|
}
|
|
8
8
|
|
package/CHANGELOG.md
CHANGED
|
@@ -4,12 +4,22 @@ 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.30](https://github.com/eea/volto-eea-map/compare/0.1.29...0.1.30) - 4 November 2022
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- jest transforms [Andrei Grigore - [`432aeee`](https://github.com/eea/volto-eea-map/commit/432aeeec40be5ecbb04c119df347be5d03950426)]
|
|
12
|
+
- cy10/razzle4 updates [Andrei Grigore - [`419fe6b`](https://github.com/eea/volto-eea-map/commit/419fe6b8a7cfbc7561ba2585a2cc4f5a7583fac5)]
|
|
13
|
+
- config new slate route [andreiggr - [`5343926`](https://github.com/eea/volto-eea-map/commit/5343926755aa0ace5ee4741e00df3aa4679e8bd7)]
|
|
14
|
+
- use alpha in cy [andreiggr - [`775a92c`](https://github.com/eea/volto-eea-map/commit/775a92c959013a08c9a5c9c121df798a289088a9)]
|
|
15
|
+
- update embed version and slate from volto [andreiggr - [`72bcc90`](https://github.com/eea/volto-eea-map/commit/72bcc90b993b1a40f81e272a6b15b41c9cf59f1b)]
|
|
16
|
+
### [0.1.29](https://github.com/eea/volto-eea-map/compare/0.1.28...0.1.29) - 19 October 2022
|
|
17
|
+
|
|
7
18
|
### [0.1.28](https://github.com/eea/volto-eea-map/compare/0.1.27...0.1.28) - 7 October 2022
|
|
8
19
|
|
|
9
20
|
#### :hammer_and_wrench: Others
|
|
10
21
|
|
|
11
22
|
- Clear [andreiggr - [`cef77e6`](https://github.com/eea/volto-eea-map/commit/cef77e6bf85f919c4968d5001f342c7d6c0e63f5)]
|
|
12
|
-
- Custom base import [andreiggr - [`ac15d5a`](https://github.com/eea/volto-eea-map/commit/ac15d5aa8edb3dc33b317f47fc11424e74035ce8)]
|
|
13
23
|
### [0.1.27](https://github.com/eea/volto-eea-map/compare/0.1.26...0.1.27) - 7 October 2022
|
|
14
24
|
|
|
15
25
|
#### :hammer_and_wrench: Others
|
package/jest-addon.config.js
CHANGED
|
@@ -11,16 +11,14 @@ module.exports = {
|
|
|
11
11
|
'@package/(.*)$': '<rootDir>/src/$1',
|
|
12
12
|
'@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
|
|
13
13
|
'@eeacms/(.*?)/(.*)$': '<rootDir>/src/addons/$1/src/$2',
|
|
14
|
-
'volto-slate
|
|
14
|
+
'@plone/volto-slate':
|
|
15
|
+
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
|
|
15
16
|
'~/(.*)$': '<rootDir>/src/$1',
|
|
16
17
|
'load-volto-addons':
|
|
17
18
|
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
|
|
18
19
|
},
|
|
19
20
|
transform: {
|
|
20
21
|
'^.+\\.js(x)?$': 'babel-jest',
|
|
21
|
-
'^.+\\.css$': 'jest-css-modules',
|
|
22
|
-
'^.+\\.less$': 'jest-css-modules',
|
|
23
|
-
'^.+\\.scss$': 'jest-css-modules',
|
|
24
22
|
'^.+\\.(png)$': 'jest-file',
|
|
25
23
|
'^.+\\.(jpg)$': 'jest-file',
|
|
26
24
|
'^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-eea-map",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"description": "@eeacms/volto-eea-map: Volto add-on",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -17,16 +17,14 @@
|
|
|
17
17
|
"url": "git@github.com:eea/volto-eea-map.git"
|
|
18
18
|
},
|
|
19
19
|
"addons": [
|
|
20
|
-
"@eeacms/volto-embed"
|
|
21
|
-
"volto-slate"
|
|
20
|
+
"@eeacms/volto-embed"
|
|
22
21
|
],
|
|
23
22
|
"dependencies": {
|
|
24
|
-
"@eeacms/volto-embed": "
|
|
23
|
+
"@eeacms/volto-embed": "5.0.0",
|
|
25
24
|
"@plone/scripts": "*",
|
|
26
25
|
"esri-loader": "3.6.0",
|
|
27
26
|
"lodash": "4.17.21",
|
|
28
|
-
"react-querybuilder": "4.2.3"
|
|
29
|
-
"volto-slate": "*"
|
|
27
|
+
"react-querybuilder": "4.2.3"
|
|
30
28
|
},
|
|
31
29
|
"devDependencies": {
|
|
32
30
|
"@cypress/code-coverage": "^3.9.5",
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { UniversalLink, Icon } from '@plone/volto/components';
|
|
3
3
|
|
|
4
4
|
import LegendWidget from './widgets/LegendWidget';
|
|
5
|
-
import { serializeNodes } from 'volto-slate/editor/render';
|
|
5
|
+
import { serializeNodes } from '@plone/volto-slate/editor/render';
|
|
6
6
|
|
|
7
7
|
import rightKeySVG from '@plone/volto/icons/right-key.svg';
|
|
8
8
|
import downKeySVG from '@plone/volto/icons/down-key.svg';
|
|
@@ -146,41 +146,48 @@ const Webmap = (props) => {
|
|
|
146
146
|
map_layers && map_layers.length > 0
|
|
147
147
|
? map_layers
|
|
148
148
|
.filter(({ map_service_url, layer }) => map_service_url && layer)
|
|
149
|
-
.map(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
149
|
+
.map(
|
|
150
|
+
(
|
|
151
|
+
{ map_service_url, layer, fullLayer, query = '', opacity = 1 },
|
|
152
|
+
index,
|
|
153
|
+
) => {
|
|
154
|
+
const url = `${map_service_url}/${layer?.id}`;
|
|
155
|
+
let mapLayer;
|
|
156
|
+
switch (layer.type) {
|
|
157
|
+
case 'Raster Layer':
|
|
158
|
+
mapLayer = new MapImageLayer({
|
|
159
|
+
url: map_service_url,
|
|
160
|
+
sublayers: [
|
|
161
|
+
{
|
|
162
|
+
id: layer.id,
|
|
163
|
+
minScale: layer?.minScale,
|
|
164
|
+
maxScale: layer?.maxScale,
|
|
165
|
+
opacity: opacity ? parseFloat(opacity) : 1,
|
|
166
|
+
definitionExpression: query
|
|
167
|
+
? formatQuery(query, 'sql')
|
|
168
|
+
: '',
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
});
|
|
172
|
+
break;
|
|
173
|
+
case 'Feature Layer':
|
|
174
|
+
mapLayer = new FeatureLayer({
|
|
175
|
+
layerId: layer.id,
|
|
176
|
+
url,
|
|
177
|
+
definitionExpression: query
|
|
178
|
+
? formatQuery(query, 'sql')
|
|
179
|
+
: '',
|
|
180
|
+
minScale: layer?.minScale,
|
|
181
|
+
maxScale: layer?.maxScale,
|
|
182
|
+
opacity: opacity ? parseFloat(opacity) : 1,
|
|
183
|
+
});
|
|
184
|
+
break;
|
|
185
|
+
default:
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
return mapLayer;
|
|
189
|
+
},
|
|
190
|
+
)
|
|
184
191
|
: [];
|
|
185
192
|
|
|
186
193
|
const mapBaseLayer = new WebTileLayer({
|
|
@@ -4,7 +4,7 @@ import { Input, Select, Button, Grid, Checkbox } from 'semantic-ui-react';
|
|
|
4
4
|
import { QueryBuilder } from 'react-querybuilder';
|
|
5
5
|
import 'react-querybuilder/dist/query-builder.css';
|
|
6
6
|
|
|
7
|
-
import RichTextWidget from 'volto-slate/widgets/RichTextWidget';
|
|
7
|
+
import RichTextWidget from '@plone/volto-slate/widgets/RichTextWidget';
|
|
8
8
|
|
|
9
9
|
import { connect } from 'react-redux';
|
|
10
10
|
import { compose } from 'redux';
|
|
@@ -172,6 +172,13 @@ const LayerSelectWidget = (props) => {
|
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
+
const handleOpacityChange = (val) => {
|
|
176
|
+
onChange(id, {
|
|
177
|
+
...value,
|
|
178
|
+
opacity: val,
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
|
|
175
182
|
const handleChangeServiceUrl = (value) => {
|
|
176
183
|
setServiceUrlError('');
|
|
177
184
|
setCheckColor('');
|
|
@@ -285,6 +292,27 @@ const LayerSelectWidget = (props) => {
|
|
|
285
292
|
)}
|
|
286
293
|
{availableLayers && availableLayers.length > 0 && selectedLayer && (
|
|
287
294
|
<div className="spaced-row">
|
|
295
|
+
<Grid.Row stretched>
|
|
296
|
+
<h5>Opacity:</h5>
|
|
297
|
+
<input
|
|
298
|
+
className="map-number-input"
|
|
299
|
+
type="number"
|
|
300
|
+
min={0}
|
|
301
|
+
max={1}
|
|
302
|
+
step={0.1}
|
|
303
|
+
value={value?.opacity ? value?.opacity : 1}
|
|
304
|
+
onChange={(e) => handleOpacityChange(e.target.value)}
|
|
305
|
+
/>
|
|
306
|
+
<input
|
|
307
|
+
className="map-range-input"
|
|
308
|
+
type="range"
|
|
309
|
+
min={0}
|
|
310
|
+
max={1}
|
|
311
|
+
step={0.1}
|
|
312
|
+
value={value?.opacity ? value?.opacity : 1}
|
|
313
|
+
onChange={(e) => handleOpacityChange(e.target.value)}
|
|
314
|
+
/>
|
|
315
|
+
</Grid.Row>
|
|
288
316
|
<Grid.Row stretched>
|
|
289
317
|
<h5 style={{ padding: '0', margin: '15px 0px 5px 0px' }}>
|
|
290
318
|
Description
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Button, Grid } from 'semantic-ui-react';
|
|
3
3
|
import { fetchArcGISData, setLegendColumns } from '../../utils';
|
|
4
4
|
import { Icon } from '@plone/volto/components';
|
|
5
|
-
import { serializeNodes } from 'volto-slate/editor/render';
|
|
5
|
+
import { serializeNodes } from '@plone/volto-slate/editor/render';
|
|
6
6
|
|
|
7
7
|
import rightKeySVG from '@plone/volto/icons/right-key.svg';
|
|
8
8
|
import downKeySVG from '@plone/volto/icons/down-key.svg';
|
package/src/styles/map.css
CHANGED