@eeacms/volto-arcgis-block 0.1.277 → 0.1.279

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,38 @@ 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.279](https://github.com/eea/volto-arcgis-block/compare/0.1.278...0.1.279) - 10 May 2024
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - CLMS-2802 (chore): Deleted commented unused code for this ticket [Unai Bolivar - [`99ae470`](https://github.com/eea/volto-arcgis-block/commit/99ae470de8a63ee0d1c5c09f751ed589a7639765)]
12
+ - CLMS-2802 (bug): filtered hotspot layers swap index orders in map when dataset orders are changed in the active layers tab [Unai Bolivar - [`1b37250`](https://github.com/eea/volto-arcgis-block/commit/1b37250d4d23b34e1d944ebcd716ba0389692690)]
13
+ ### [0.1.278](https://github.com/eea/volto-arcgis-block/compare/0.1.277...0.1.278) - 9 May 2024
14
+
15
+ #### :hammer_and_wrench: Others
16
+
17
+ - no test results to report to Sonarqube [Mikel Larreategi - [`1ed9656`](https://github.com/eea/volto-arcgis-block/commit/1ed965655ee4c75c8e9b0ae61596a43717fb4f2a)]
18
+ - comment Cypress tests [Ion Lizarazu - [`4d6bb58`](https://github.com/eea/volto-arcgis-block/commit/4d6bb582f8fd327a99f723ca1b869456c97ac45d)]
19
+ - Jenkinsfile variables [Ion Lizarazu - [`87bdcb3`](https://github.com/eea/volto-arcgis-block/commit/87bdcb3508153e016d6a2a4510108df4fe6f7072)]
20
+ - CLMS-3213 (bug): Fixed geojson file size exceeded error message [Unai Bolivar - [`56bb6de`](https://github.com/eea/volto-arcgis-block/commit/56bb6de04eb7e07d488597576a551567f2679912)]
21
+ - CLMS-3204-3210 (bug): error messages displayed for files uploaded with incorrect EPSG or multiple registers [Unai Bolivar - [`f22a1ce`](https://github.com/eea/volto-arcgis-block/commit/f22a1ce04d470d4041b0ad78788df9ae8cde1a56)]
22
+ - CLMS-2589 (bug): re uploading this ticket [Unai Bolivar - [`69ce853`](https://github.com/eea/volto-arcgis-block/commit/69ce8537e12ff4f6a18ef5b4c542fce6bed9d583)]
23
+ - CLMS-2589 (bug): Final check before push to demo passed [ujbolivar - [`0bb88f3`](https://github.com/eea/volto-arcgis-block/commit/0bb88f3fd60f603ff239ed632bc6a0607e6fd6aa)]
24
+ - CLMS-3163 (bug): cosmetic corrections: draw rectangle popo up header icon and text separation is the same for all messages. [Unai Bolivar - [`9b491f7`](https://github.com/eea/volto-arcgis-block/commit/9b491f78ab657c44d10f1b60d0da8ece1717f8d0)]
25
+ - CLMS-3163 (bug): cosmetic corrections: area widget spacing corrected. [Unai Bolivar - [`89a7e05`](https://github.com/eea/volto-arcgis-block/commit/89a7e05cb792c362b55a56993913ce2254a84682)]
26
+ - CLMS-2589 (bug): Active layers load correctly every time a bookmark is selected [Unai Bolivar - [`4f88f9e`](https://github.com/eea/volto-arcgis-block/commit/4f88f9eac02c66c57548daba5aa65a0b4e75f9a4)]
27
+ - CLMS-2589 (BUG): Corrected hotspot filter search wwhen bookmark is selected and not fiot filter search when bookmark is selected and no filters were applied [ujbolivar - [`eb1511c`](https://github.com/eea/volto-arcgis-block/commit/eb1511cbdb555a2a3df65ff3b53037b514c99528)]
28
+ - CLMS-2589 (bug): bew fix for filtered hotspots in bookmark selection [Unai Bolivar - [`d0372f8`](https://github.com/eea/volto-arcgis-block/commit/d0372f8d5b0d63e125305bccca91ef344dce3d5c)]
29
+ - CLMS-2589 (bug): bookmkar visibility and cross loads functions [Unai Bolivar - [`62c6d61`](https://github.com/eea/volto-arcgis-block/commit/62c6d61ef76c56350f1aed78e44014a4a26949bd)]
30
+ - CLMS-2589 (bug): bookmarked hotspot filters load visibility and opacity correctly [Unai Bolivar - [`b193750`](https://github.com/eea/volto-arcgis-block/commit/b1937505b63dcaf27fefb62b8407465f2f7126f2)]
31
+ - CLMS-2589 (bug): bookmarked hotspot filters load correctly now and layers are not destroyed in map [Unai Bolivar - [`66d41ba`](https://github.com/eea/volto-arcgis-block/commit/66d41baa3a37ad25fd414dc5ea672ce94adbe9ba)]
32
+ - CLMS-2589 (bug): bookmarked hotspot filters laod correctly and display correct values in active layers tab. [Unai Bolivar - [`261b22e`](https://github.com/eea/volto-arcgis-block/commit/261b22eb54bc0ba55ed565b0a8c12d3f640a5309)]
33
+ - CLMS-2589 (bug): bookmarked layers load correctly [Unai Bolivar - [`889e59e`](https://github.com/eea/volto-arcgis-block/commit/889e59e6b2adeecbab888fe46dde66671ff5fcde)]
34
+ - CLMS-2589 (bug): Fixed bookmark bug missing props [Unai Bolivar - [`f2681e9`](https://github.com/eea/volto-arcgis-block/commit/f2681e98081ca1dea5988413478e5313524bd31e)]
35
+ - CLMS-3096 (bug): implemented fix for bookmark opacity [Unai Bolivar - [`53e083f`](https://github.com/eea/volto-arcgis-block/commit/53e083ff181830bfd2949dfb1c71a6beb0907591)]
36
+ - CLMS-3095 (bug): commented unused functions [Unai Bolivar - [`1c90c17`](https://github.com/eea/volto-arcgis-block/commit/1c90c179c74c3e5bd176337d66ecc0e0c1d31867)]
37
+ - CLMS-3095 (bug): corrected legend titles [Unai Bolivar - [`70275de`](https://github.com/eea/volto-arcgis-block/commit/70275def4b3c1979e03f4409d7ca7eed27c186bd)]
38
+ - CLMS-3095 (bug): legend title not displaying correctly [ujbolivar - [`5fd0a9b`](https://github.com/eea/volto-arcgis-block/commit/5fd0a9bc4983c43feb5418e3ec65e08a70689615)]
7
39
  ### [0.1.277](https://github.com/eea/volto-arcgis-block/compare/0.1.276...0.1.277) - 24 April 2024
8
40
 
9
41
  ### [0.1.276](https://github.com/eea/volto-arcgis-block/compare/0.1.275...0.1.276) - 23 April 2024
package/Jenkinsfile CHANGED
@@ -9,7 +9,9 @@ pipeline {
9
9
  NAMESPACE = "@eeacms"
10
10
  SONARQUBE_TAGS = "volto.eea.europa.eu,clms.land.copernicus.eu,water.europa.eu-freshwater,clmsdemo.devel6cph.eea.europa.eu,land.copernicus.eu"
11
11
  DEPENDENCIES = ""
12
- VOLTO = "15.16.0"
12
+ BACKEND_PROFILES = "eea.kitkat:testing"
13
+ BACKEND_ADDONS = "clms.addon,clms.types,clms.downloadtool,clms.statstool"
14
+ VOLTO = "16.31.1"
13
15
  }
14
16
 
15
17
  stages {
@@ -120,105 +122,105 @@ pipeline {
120
122
  }
121
123
  }
122
124
 
123
- stage('Integration tests') {
124
- when {
125
- anyOf {
126
- allOf {
127
- not { environment name: 'CHANGE_ID', value: '' }
128
- environment name: 'CHANGE_TARGET', value: 'develop'
129
- }
130
- allOf {
131
- environment name: 'CHANGE_ID', value: ''
132
- anyOf {
133
- not { changelog '.*^Automated release [0-9\\.]+$' }
134
- branch 'master'
135
- }
136
- }
137
- }
138
- }
139
- steps {
140
- parallel(
125
+ // stage('Integration tests') {
126
+ // when {
127
+ // anyOf {
128
+ // allOf {
129
+ // not { environment name: 'CHANGE_ID', value: '' }
130
+ // environment name: 'CHANGE_TARGET', value: 'develop'
131
+ // }
132
+ // allOf {
133
+ // environment name: 'CHANGE_ID', value: ''
134
+ // anyOf {
135
+ // not { changelog '.*^Automated release [0-9\\.]+$' }
136
+ // branch 'master'
137
+ // }
138
+ // }
139
+ // }
140
+ // }
141
+ // steps {
142
+ // parallel(
141
143
 
142
- "Cypress": {
143
- node(label: 'docker') {
144
- script {
145
- try {
146
- sh '''docker pull plone; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
147
- sh '''docker pull plone/volto-addon-ci:15.x; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e VOLTO=$VOLTO -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=test plone/volto-addon-ci:15.x cypress'''
148
- } finally {
149
- try {
150
- sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
151
- sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
152
- sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
153
- sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
154
- coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true
155
- if ( coverage == 0 ) {
156
- publishHTML (target : [allowMissing: false,
157
- alwaysLinkToLastBuild: true,
158
- keepAll: true,
159
- reportDir: 'cypress-coverage/coverage/lcov-report',
160
- reportFiles: 'index.html',
161
- reportName: 'CypressCoverage',
162
- reportTitles: 'Integration Tests Code Coverage'])
163
- }
164
- sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
165
- archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
166
- stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
167
- }
168
- finally {
169
- catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
170
- junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
171
- }
172
- sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
173
- sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
174
- sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true
144
+ // "Cypress": {
145
+ // node(label: 'docker') {
146
+ // script {
147
+ // try {
148
+ // sh '''docker pull plone; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
149
+ // sh '''docker pull plone/volto-addon-ci:15.x; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e VOLTO=$VOLTO -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=test plone/volto-addon-ci:15.x cypress'''
150
+ // } finally {
151
+ // try {
152
+ // sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
153
+ // sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
154
+ // sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
155
+ // sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
156
+ // coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true
157
+ // if ( coverage == 0 ) {
158
+ // publishHTML (target : [allowMissing: false,
159
+ // alwaysLinkToLastBuild: true,
160
+ // keepAll: true,
161
+ // reportDir: 'cypress-coverage/coverage/lcov-report',
162
+ // reportFiles: 'index.html',
163
+ // reportName: 'CypressCoverage',
164
+ // reportTitles: 'Integration Tests Code Coverage'])
165
+ // }
166
+ // sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
167
+ // archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
168
+ // stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
169
+ // }
170
+ // finally {
171
+ // catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
172
+ // junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
173
+ // }
174
+ // sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
175
+ // sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
176
+ // sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true
175
177
 
176
- }
177
- }
178
- }
179
- }
180
- }
178
+ // }
179
+ // }
180
+ // }
181
+ // }
182
+ // }
181
183
 
182
- )
183
- }
184
- }
184
+ // )
185
+ // }
186
+ // }
185
187
 
186
- stage('Report to SonarQube') {
187
- when {
188
- anyOf {
189
- allOf {
190
- not { environment name: 'CHANGE_ID', value: '' }
191
- environment name: 'CHANGE_TARGET', value: 'develop'
192
- }
193
- allOf {
194
- environment name: 'CHANGE_ID', value: ''
195
- anyOf {
196
- allOf {
197
- branch 'develop'
198
- not { changelog '.*^Automated release [0-9\\.]+$' }
199
- }
200
- branch 'master'
201
- }
202
- }
203
- }
204
- }
205
- steps {
206
- node(label: 'swarm') {
207
- script{
208
- checkout scm
209
- unstash "xunit-reports"
210
- unstash "cypress-coverage"
211
- def scannerHome = tool 'SonarQubeScanner';
212
- def nodeJS = tool 'NodeJS';
213
- withSonarQubeEnv('Sonarqube') {
214
- sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
215
- sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
216
- sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
217
- }
218
- }
219
- }
220
- }
221
- }
188
+ // stage('Report to SonarQube') {
189
+ // when {
190
+ // anyOf {
191
+ // allOf {
192
+ // not { environment name: 'CHANGE_ID', value: '' }
193
+ // environment name: 'CHANGE_TARGET', value: 'develop'
194
+ // }
195
+ // allOf {
196
+ // environment name: 'CHANGE_ID', value: ''
197
+ // anyOf {
198
+ // allOf {
199
+ // branch 'develop'
200
+ // not { changelog '.*^Automated release [0-9\\.]+$' }
201
+ // }
202
+ // branch 'master'
203
+ // }
204
+ // }
205
+ // }
206
+ // }
207
+ // steps {
208
+ // node(label: 'swarm') {
209
+ // script{
210
+ // checkout scm
211
+ // unstash "xunit-reports"
212
+ // unstash "cypress-coverage"
213
+ // def scannerHome = tool 'SonarQubeScanner';
214
+ // def nodeJS = tool 'NodeJS';
215
+ // withSonarQubeEnv('Sonarqube') {
216
+ // sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
217
+ // sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
218
+ // sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
219
+ // }
220
+ // }
221
+ // }
222
+ // }
223
+ // }
222
224
  /*
223
225
  stage('SonarQube compare to master') {
224
226
  when {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.277",
3
+ "version": "0.1.279",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -62,7 +62,7 @@
62
62
  "@fortawesome/fontawesome-svg-core": "1.2.35",
63
63
  "@fortawesome/free-solid-svg-icons": "5.15.3",
64
64
  "@fortawesome/react-fontawesome": "0.1.14",
65
- "esri-loader": "3.1.0",
65
+ "esri-loader": "3.4.0",
66
66
  "highcharts": "^9.3.2",
67
67
  "highcharts-react-official": "^3.1.0",
68
68
  "react-datepicker": "4.10.0"
@@ -123,6 +123,16 @@ class AreaWidget extends React.Component {
123
123
  this.container.current.querySelector(
124
124
  '.right-panel-content',
125
125
  ).style.overflowY = 'auto';
126
+ this.container.current.querySelector(
127
+ '.right-panel-content',
128
+ ).style.display = 'none';
129
+ this.container.current.querySelector(
130
+ '.right-panel-content',
131
+ ).style.alignItems = 'none';
132
+ this.container.current.querySelector('.area-panel').style.display =
133
+ 'none';
134
+ this.container.current.querySelector('.area-panel').style.flexWrap =
135
+ 'none';
126
136
  this.container.current
127
137
  .querySelector('.esri-widget--button')
128
138
  .classList.remove('active-widget');
@@ -148,6 +158,16 @@ class AreaWidget extends React.Component {
148
158
  this.container.current.querySelector(
149
159
  '.right-panel-content',
150
160
  ).style.overflowY = 'hidden';
161
+ this.container.current.querySelector(
162
+ '.right-panel-content',
163
+ ).style.display = 'flex';
164
+ this.container.current.querySelector(
165
+ '.right-panel-content',
166
+ ).style.alignItems = 'center';
167
+ this.container.current.querySelector('.area-panel').style.display =
168
+ 'flex';
169
+ this.container.current.querySelector('.area-panel').style.flexWrap =
170
+ 'wrap';
151
171
  this.container.current
152
172
  .querySelector('.esri-widget--button')
153
173
  .classList.add('active-widget');
@@ -405,6 +425,16 @@ class AreaWidget extends React.Component {
405
425
  showInfoPopup: true,
406
426
  infoPopupType: 'invalidShapefile',
407
427
  });
428
+ } else if (
429
+ error &&
430
+ error.details &&
431
+ error.details.httpStatus === 400 &&
432
+ error.message === 'Invalid spatial reference in geojson.'
433
+ ) {
434
+ this.setState({
435
+ showInfoPopup: true,
436
+ infoPopupType: 'incorrectWkid',
437
+ });
408
438
  } else {
409
439
  // Handle other errors
410
440
  }
@@ -435,6 +465,7 @@ class AreaWidget extends React.Component {
435
465
  graphic.symbol = polygonSymbol;
436
466
  return graphic;
437
467
  });
468
+
438
469
  sourceGraphics = sourceGraphics.concat(graphics);
439
470
 
440
471
  // Create a feature layer from the feature collection fields and gaphics
@@ -521,8 +552,8 @@ class AreaWidget extends React.Component {
521
552
 
522
553
  //Check if the featurecollection has more than one feature
523
554
 
524
- checkFeatureCount(layers) {
525
- if (layers.layers[0].featureSet.features.length > 1) {
555
+ checkFeatureCount(featureCollection) {
556
+ if (featureCollection.layers[0].featureSet.features.length > 1) {
526
557
  this.setState({
527
558
  showInfoPopup: true,
528
559
  infoPopupType: 'singleFeature',
@@ -1084,7 +1115,6 @@ class AreaWidget extends React.Component {
1084
1115
  </div>
1085
1116
  </fieldset>
1086
1117
  </div>
1087
- <br />
1088
1118
  <div className="area-header">
1089
1119
  Upload a file with your area of interest
1090
1120
  <a
@@ -1192,8 +1222,7 @@ class AreaWidget extends React.Component {
1192
1222
  <FontAwesomeIcon icon={['fas', 'info-circle']} />
1193
1223
  </span>
1194
1224
  <div className="drawRectanglePopup-text">
1195
- Uploading geojson or csv files larger than 10MB is not
1196
- allowed.
1225
+ Uploading geojson files larger than 10MB is not allowed.
1197
1226
  </div>
1198
1227
  </>
1199
1228
  )}
@@ -1224,8 +1253,7 @@ class AreaWidget extends React.Component {
1224
1253
  <FontAwesomeIcon icon={['fas', 'info-circle']} />
1225
1254
  </span>
1226
1255
  <div className="drawRectanglePopup-text">
1227
- Uploading files with more than a single feature is not
1228
- allowed.
1256
+ The file can’t contain more than one register.
1229
1257
  </div>
1230
1258
  </>
1231
1259
  )}
@@ -252,6 +252,17 @@ class BookmarkWidget extends React.Component {
252
252
  JSON.stringify(this.sessionBookmarkHotspot),
253
253
  );
254
254
  }
255
+
256
+ let bookmarkData = {
257
+ ...(this.props.bookmarkData || {}),
258
+ active: false,
259
+ layers: this.sessionBookmarkLayers,
260
+ opacity: this.sessionBookmarkOpacity,
261
+ visible: this.sessionBookmarkVisible,
262
+ position: null,
263
+ };
264
+
265
+ this.props.bookmarkHandler(bookmarkData);
255
266
  });
256
267
  this.Bookmarks.on('bookmark-edit', (e) => {
257
268
  let check = JSON.parse(sessionStorage.getItem('checkedLayers')) || [];
@@ -271,12 +282,20 @@ class BookmarkWidget extends React.Component {
271
282
  activeLayers: {},
272
283
  filteredLayers: {},
273
284
  };
274
- if (this.props.hotspotData && this.props.hotspotData.activeLayers) {
285
+ if (
286
+ this.props.hotspotData &&
287
+ this.props.hotspotData.activeLayers &&
288
+ Object.keys(this.props.hotspotData.activeLayers).length !== 0
289
+ ) {
275
290
  Object.keys(this.props.hotspotData.activeLayers).forEach((key) => {
276
291
  hotspotFilters.activeLayers[key] = null;
277
292
  });
278
293
  }
279
- if (this.props.hotspotData && this.props.hotspotData.activeLayers) {
294
+ if (
295
+ this.props.hotspotData &&
296
+ this.props.hotspotData.filteredLayers &&
297
+ Object.keys(this.props.hotspotData.filteredLayers).length !== 0
298
+ ) {
280
299
  Object.keys(this.props.hotspotData.filteredLayers).forEach((key) => {
281
300
  hotspotFilters.filteredLayers[
282
301
  key
@@ -316,32 +335,69 @@ class BookmarkWidget extends React.Component {
316
335
  JSON.stringify(this.sessionBookmarkHotspot),
317
336
  );
318
337
  }
338
+
339
+ let bookmarkData = {
340
+ ...(this.props.bookmarkData || {}),
341
+ active: false,
342
+ layers: this.sessionBookmarkLayers,
343
+ opacity: this.sessionBookmarkOpacity,
344
+ visible: this.sessionBookmarkVisible,
345
+ position: null,
346
+ };
347
+
348
+ this.props.bookmarkHandler(bookmarkData);
319
349
  });
320
350
  this.Bookmarks.on('bookmark-select', (e) => {
321
351
  let selectLayers = [];
322
352
  let selectOpacity = [];
323
353
  let selectVisible = [];
354
+ let selectPosition;
324
355
  for (let index = 0; index < this.Bookmarks.bookmarks.length; index++) {
325
356
  if (e.bookmark === this.Bookmarks.bookmarks.items[index]) {
326
357
  selectLayers = this.sessionBookmarkLayers[index];
327
358
  selectOpacity = this.sessionBookmarkOpacity[index];
328
359
  selectVisible = this.sessionBookmarkVisible[index];
360
+ selectPosition = index;
329
361
  localStorage.setItem(
330
362
  'bookmarkHotspotFilter',
331
363
  JSON.stringify(this.sessionBookmarkHotspot[index]),
332
364
  );
333
365
  }
334
366
  }
335
- this.map.layers.removeAll();
336
- this.map.layers.add('bookmark');
337
367
  let layerOpacities = {};
368
+ const layerKeys = {
369
+ lcc_filter: 'all_lcc',
370
+ lc_filter: 'all_present',
371
+ klc_filter: 'cop_klc',
372
+ pa_filter: 'protected_areas',
373
+ };
338
374
  for (let index = 0; index < selectLayers.length; index++) {
339
375
  if (selectOpacity[index]) {
340
- this.layers[selectLayers[index]].opacity = selectOpacity[index];
341
- layerOpacities[selectLayers[index]] = selectOpacity[index];
376
+ Object.entries(layerKeys).forEach(([key, val]) => {
377
+ if (
378
+ this.props.hotspotData?.filteredLayers?.hasOwnProperty(key) &&
379
+ this.layers[key] &&
380
+ selectLayers[index].includes(val)
381
+ ) {
382
+ this.layers[key].opacity = selectOpacity[index];
383
+ } else {
384
+ this.layers[selectLayers[index]].opacity = selectOpacity[index];
385
+ layerOpacities[selectLayers[index]] = selectOpacity[index];
386
+ }
387
+ });
342
388
  }
343
389
  if (selectVisible[index] !== null) {
344
- this.layers[selectLayers[index]].visible = selectVisible[index];
390
+ Object.entries(layerKeys).forEach(([key, val]) => {
391
+ if (
392
+ this.props.hotspotData?.filteredLayers?.hasOwnProperty(key) &&
393
+ this.layers[key] &&
394
+ selectLayers[index].includes(val)
395
+ ) {
396
+ this.layers[key].visible = selectVisible[index];
397
+ } else {
398
+ this.layers[selectLayers[index]].visible = selectVisible[index];
399
+ }
400
+ });
345
401
  }
346
402
  }
347
403
  sessionStorage.setItem('checkedLayers', JSON.stringify(selectLayers));
@@ -349,6 +405,19 @@ class BookmarkWidget extends React.Component {
349
405
  'layerOpacities',
350
406
  JSON.stringify(layerOpacities),
351
407
  );
408
+ let bookmarkData = {
409
+ ...(this.props.bookmarkData || {}),
410
+ active: true,
411
+ layers: this.sessionBookmarkLayers,
412
+ opacity: this.sessionBookmarkOpacity,
413
+ visible: this.sessionBookmarkVisible,
414
+ position: selectPosition,
415
+ };
416
+
417
+ this.props.bookmarkHandler(bookmarkData);
418
+ this.map.layers.removeAll();
419
+ let firstLayer = Object.values(this.layers)[0];
420
+ this.map.add(firstLayer);
352
421
  });
353
422
  });
354
423
  }