@eeacms/volto-eea-map 0.1.21 → 0.1.23

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,21 @@ 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.21](https://github.com/eea/volto-eea-map/compare/0.1.20...0.1.21) - 13 September 2022
7
+ ### [0.1.23](https://github.com/eea/volto-eea-map/compare/0.1.22...0.1.23) - 14 September 2022
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - lint fix [andreiggr - [`403512e`](https://github.com/eea/volto-eea-map/commit/403512e1e354a333b71797cd4bf9bdcfb96e7134)]
12
+ - fix print sizes [andreiggr - [`c75b290`](https://github.com/eea/volto-eea-map/commit/c75b29014ca606af6ea54f003db08aad764532ab)]
13
+ - set min/max scale if available on layer [andreiggr - [`9790d7f`](https://github.com/eea/volto-eea-map/commit/9790d7fbd080fdbb6e3433d769ed7eba718cc008)]
14
+ ### [0.1.22](https://github.com/eea/volto-eea-map/compare/0.1.21...0.1.22) - 13 September 2022
8
15
 
9
16
  #### :hammer_and_wrench: Others
10
17
 
11
- - sources expandable also [andreiggr - [`cd89898`](https://github.com/eea/volto-eea-map/commit/cd89898f026a67b43779575219503eb3ce2ae6fc)]
18
+ - fine-tune useeffect [andreiggr - [`d7d9d7b`](https://github.com/eea/volto-eea-map/commit/d7d9d7b8dbf510dead8b1acc85bc29c64d0449d2)]
19
+ - update documentation [andreiggr - [`0af2227`](https://github.com/eea/volto-eea-map/commit/0af22279f89b73107df7804e81a3a30b8f13a730)]
20
+ ### [0.1.21](https://github.com/eea/volto-eea-map/compare/0.1.20...0.1.21) - 13 September 2022
21
+
12
22
  ### [0.1.20](https://github.com/eea/volto-eea-map/compare/0.1.19...0.1.20) - 31 August 2022
13
23
 
14
24
  #### :hammer_and_wrench: Others
package/README.md CHANGED
@@ -1,103 +1,87 @@
1
1
  # volto-addon-template
2
2
 
3
- [![Releases](https://img.shields.io/github/v/release/eea/volto-addon-template)](https://github.com/eea/volto-addon-template/releases)
3
+ [![Releases](https://img.shields.io/github/v/release/eea/volto-eea-map)](https://github.com/eea/volto-eea-map/releases)
4
4
 
5
- [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-addon-template%2Fmaster&subject=master)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-addon-template/job/master/display/redirect)
6
- [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-master&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-master)
7
- [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-master&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-master)
8
- [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-master&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-master)
9
- [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-master&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-master)
5
+ [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-eea-map%2Fmaster&subject=master)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-eea-map/job/master/display/redirect)
6
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-map-master&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-map-master)
7
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-map-master&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-map-master)
8
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-map-master&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-map-master)
9
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-map-master&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-map-master)
10
10
 
11
- [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-addon-template%2Fdevelop&subject=develop)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-addon-template/job/develop/display/redirect)
12
- [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-develop&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-develop)
13
- [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-develop&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-develop)
14
- [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-develop)
15
- [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-develop)
11
+ [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-eea-map%2Fdevelop&subject=develop)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-eea-map/job/develop/display/redirect)
12
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-map-develop&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-map-develop)
13
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-map-develop&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-map-develop)
14
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-map-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-map-develop)
15
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-map-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-map-develop)
16
16
 
17
17
 
18
18
  [Volto](https://github.com/plone/volto) add-on
19
19
 
20
- ## Features
20
+ # volto-eea-map
21
21
 
22
- Demo GIF
22
+ Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
23
23
 
24
- ## Getting started
24
+ 1. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs-developer`
25
25
 
26
- ### Try volto-addon-template with Docker
26
+ npm install -g yo @plone/generator-volto mrs-developer
27
27
 
28
- 1. Get the latest Docker images
28
+ 1. Create new volto app
29
29
 
30
- ```
31
- docker pull plone
32
- docker pull plone/volto
33
- ```
30
+ yo @plone/volto my-volto-project --addon @eeacms/volto-eea-map --skip-install
31
+ cd my-volto-project
34
32
 
35
- 1. Start Plone backend
36
- ```
37
- docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
38
- ```
33
+ 1. Add the following to `mrs.developer.json`:
39
34
 
40
- 1. Start Volto frontend
35
+ {
36
+ "volto-eea-map": {
37
+ "url": "https://github.com/eea/volto-eea-map.git",
38
+ "package": "@eeacms/volto-eea-map",
39
+ "branch": "develop",
40
+ "path": "src"
41
+ }
42
+ }
41
43
 
42
- ```
43
- docker run -it --rm -p 3000:3000 --link plone -e ADDONS="@eeacms/volto-addon-template" plone/volto
44
- ```
44
+ 1. Install
45
45
 
46
- 1. Go to http://localhost:3000
46
+ yarn develop
47
+ yarn
47
48
 
48
- ### Add volto-addon-template to your Volto project
49
+ 1. Start backend
49
50
 
50
- 1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
51
+ docker pull plone
52
+ docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
51
53
 
52
- 1. Start Volto frontend
54
+ ...wait for backend to setup and start - `Ready to handle requests`:
53
55
 
54
- * If you already have a volto project, just update `package.json`:
56
+ docker logs -f plone
55
57
 
56
- ```JSON
57
- "addons": [
58
- "@eeacms/volto-addon-template"
59
- ],
58
+ ...you can also check http://localhost:8080/Plone
60
59
 
61
- "dependencies": {
62
- "@eeacms/volto-addon-template": "^1.0.0"
63
- }
64
- ```
60
+ 1. Start frontend
65
61
 
66
- * If not, create one:
62
+ yarn start
67
63
 
68
- ```
69
- npm install -g yo @plone/generator-volto
70
- yo @plone/volto my-volto-project --addon @eeacms/volto-addon-template
71
- cd my-volto-project
72
- ```
64
+ 1. Go to http://localhost:3000
73
65
 
74
- 1. Install new add-ons and restart Volto:
66
+ 1. Happy hacking!
75
67
 
76
- ```
77
- yarn
78
- yarn start
79
- ```
68
+ cd src/addons/volto-eea-map/
80
69
 
81
- 1. Go to http://localhost:3000
70
+ # Configuration
82
71
 
83
- 1. Happy editing!
72
+ This addon contains the EEA Embed Map Block & EEA Map Block. It's configured to work with the map visualization content type and give more access to ArcGIS maps. See available maps here https://discomap.eea.europa.eu/
84
73
 
85
- ## Release
74
+ # Enable data queries auto-import
86
75
 
87
- See [RELEASE.md](https://github.com/eea/volto-addon-template/blob/master/RELEASE.md).
76
+ To enable automatic import of queries from the content-type, "Parameters for data connections" should be checked as behavior on the content-type that uses the map.
88
77
 
89
- ## How to contribute
78
+ controlpanel/dexterity-types/{content-type-id}
79
+ # Enable Sources
90
80
 
91
- See [DEVELOP.md](https://github.com/eea/volto-addon-template/blob/master/DEVELOP.md).
81
+ Sources (Data provenance) should be set on the visualization. To enable this, "EEA Core Metadata" should be checked as behavior on the visualization content-type.
92
82
 
93
- ## Copyright and license
83
+ controlpanel/dexterity-types/map_visualization
84
+
85
+ After this, sources can be added from the visualization edit interface. "Data Provenance" tab => "Add source"
94
86
 
95
- The Initial Owner of the Original Code is European Environment Agency (EEA).
96
- All Rights Reserved.
97
-
98
- See [LICENSE.md](https://github.com/eea/volto-addon-template/blob/master/LICENSE.md) for details.
99
-
100
- ## Funding
101
-
102
- [European Environment Agency (EU)](http://eea.europa.eu)
103
87
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-map",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
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",
@@ -34,8 +34,7 @@ const Edit = (props) => {
34
34
  });
35
35
  }
36
36
  // eslint-disable-next-line react-hooks/exhaustive-deps
37
- }, [props.data_query, block, data]);
38
-
37
+ }, [props.block, props.data_query, data.data_query_params]);
39
38
  return (
40
39
  <div>
41
40
  <View data={data} id={id} isEdit={true} />
@@ -101,6 +101,8 @@ const Webmap = (props) => {
101
101
  case 'Raster Layer':
102
102
  mapLayer = new MapImageLayer({
103
103
  url: map_service_url,
104
+ minScale: layer.minScale ? layer.minScale : '',
105
+ maxScale: layer.maxScale ? layer.maxScale : '',
104
106
  });
105
107
  break;
106
108
  case 'Feature Layer':
@@ -109,6 +111,8 @@ const Webmap = (props) => {
109
111
  definitionExpression: query
110
112
  ? formatQuery(query, 'sql')
111
113
  : '',
114
+ minScale: layer.minScale ? layer.minScale : '',
115
+ maxScale: layer.maxScale ? layer.maxScale : '',
112
116
  });
113
117
  break;
114
118
  case 'Group Layer':
@@ -124,7 +128,7 @@ const Webmap = (props) => {
124
128
  basemap: base_layer || 'hybrid',
125
129
  layers,
126
130
  });
127
-
131
+ console.log(layers, 'the layers');
128
132
  const view = new MapView({
129
133
  container: mapRef.current,
130
134
  map,
@@ -78,6 +78,7 @@ const LayerLegend = ({ data, show_viewer }) => {
78
78
  <span key={i} style={{ display: 'flex', alignItems: 'center' }}>
79
79
  <img
80
80
  alt="alt"
81
+ className="layer-legend-item-color"
81
82
  src={`data:image/png;base64,${item.imageData}`}
82
83
  />
83
84
  <span style={{ fontSize: '13px', marginLeft: '5px' }}>
@@ -196,3 +196,10 @@
196
196
  transform: translate3d(0, 0, 0);
197
197
  }
198
198
  }
199
+
200
+ @media print {
201
+ .layer-legend-item-color {
202
+ max-width: 0.2cm;
203
+ height: 0.2cm;
204
+ }
205
+ }