@eeacms/volto-arcgis-block 0.1.434 → 0.1.436

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,19 @@ 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.436](https://github.com/eea/volto-arcgis-block/compare/0.1.435...0.1.436) - 12 March 2026
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - (bug): measurement and area widget in 3D fixes [Unai Bolivar - [`b42a3ee`](https://github.com/eea/volto-arcgis-block/commit/b42a3ee5670678058edbb8cb4ebfe205916f944f)]
12
+ - (bug): enforce space gap between geocoder bar and toc menu in 2D and 3D to same distance [Unai Bolivar - [`0ffc993`](https://github.com/eea/volto-arcgis-block/commit/0ffc993adedda8300d53d90704e96a057da2632f)]
13
+ - (bug): 3D button placement [Unai Bolivar - [`9d94157`](https://github.com/eea/volto-arcgis-block/commit/9d9415730ab8196b9012a6d415a614ff8a8c34c7)]
14
+ ### [0.1.435](https://github.com/eea/volto-arcgis-block/compare/0.1.434...0.1.435) - 10 March 2026
15
+
16
+ #### :hammer_and_wrench: Others
17
+
18
+ - (bug): Fix Upload widget TOC menu stored services correct loading in 2D and 3D [Unai Bolivar - [`8b9e5fa`](https://github.com/eea/volto-arcgis-block/commit/8b9e5fad5a7d361e8fa4c8f48ae771422ae1c262)]
19
+ - (bug): fix upload widget error report, loading spinner, and TOC menu cleanup in 3D [Unai Bolivar - [`dc2ab0d`](https://github.com/eea/volto-arcgis-block/commit/dc2ab0d5ecafdb1cdc9c417bd8533c7ff0f28446)]
7
20
  ### [0.1.434](https://github.com/eea/volto-arcgis-block/compare/0.1.433...0.1.434) - 10 March 2026
8
21
 
9
22
  #### :hammer_and_wrench: Others
@@ -22,7 +35,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
22
35
 
23
36
  #### :house: Internal changes
24
37
 
25
- - chore: [JENKINSFILE] use sonarqube [valentinab25 - [`ec5e822`](https://github.com/eea/volto-arcgis-block/commit/ec5e8229c968e8cb5239e493537e0559435fe67e)]
26
38
 
27
39
  #### :hammer_and_wrench: Others
28
40
 
@@ -38,9 +50,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
38
50
 
39
51
  #### :house: Internal changes
40
52
 
41
- - chore: [JENKINSFILE] add package version in sonarqube [valentinab25 - [`78addd9`](https://github.com/eea/volto-arcgis-block/commit/78addd9908a5a16eb8b8c984b6d98fe992af4449)]
42
- - chore: [JENKINSFILE] add package version in sonarqube [EEA Jenkins - [`3001a9d`](https://github.com/eea/volto-arcgis-block/commit/3001a9d84c1ceb2072d2c8fdf42b75b0fa2a36c7)]
43
- - chore: [JENKINSFILE] add sonarqube branches Refs #293878 [EEA Jenkins - [`3430596`](https://github.com/eea/volto-arcgis-block/commit/34305966fc548b9213d2a914cdd61fdb4ef3a973)]
44
53
 
45
54
  ### [0.1.430](https://github.com/eea/volto-arcgis-block/compare/0.1.429...0.1.430) - 19 February 2026
46
55
 
@@ -350,7 +359,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
350
359
 
351
360
  #### :hammer_and_wrench: Others
352
361
 
353
- - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`fa8e13d`](https://github.com/eea/volto-arcgis-block/commit/fa8e13da184b9a9146cb65aca7a89c05fb0261ba)]
354
362
  ### [0.1.372](https://github.com/eea/volto-arcgis-block/compare/0.1.371...0.1.372) - 26 June 2025
355
363
 
356
364
  #### :hammer_and_wrench: Others
@@ -377,11 +385,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
377
385
 
378
386
  #### :house: Internal changes
379
387
 
380
- - chore: [JENKINS] fix variable, uncomment tests [valentinab25 - [`00d88b5`](https://github.com/eea/volto-arcgis-block/commit/00d88b52265cba983d1d5e21a49c051004b705b5)]
381
- - chore: [JENKINS] use clms-theme pipeline [valentinab25 - [`52b392c`](https://github.com/eea/volto-arcgis-block/commit/52b392cc993f3767099525ed39249e574ce2b421)]
382
- - chore: [JENKINS] use volto 16 pipeline [valentinab25 - [`a676671`](https://github.com/eea/volto-arcgis-block/commit/a676671186aa227f4c77a766b9ca852028168b5c)]
383
- - chore: [JENKINS] fix Dockerfile to use eea frontend-builder [valentinab25 - [`980608c`](https://github.com/eea/volto-arcgis-block/commit/980608cc867ace42896831791a55c535838250ee)]
384
- - chore: [JENKINS] update Makefile for Jenkins [valentinab25 - [`021267e`](https://github.com/eea/volto-arcgis-block/commit/021267e620d6529327a730f122a39f7fec53b293)]
385
388
 
386
389
  #### :hammer_and_wrench: Others
387
390
 
@@ -426,7 +429,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
426
429
  - Merge pull request #945 from eea/CLMS-285178-ISOLATED-SWIPE-WIDGET-FIX [Unai Bolivar - [`617b4c4`](https://github.com/eea/volto-arcgis-block/commit/617b4c43ad4363267c4df34c72e64314ee42afb4)]
427
430
  - CLMS-285178 (bug): Separated swipe from other tickets and can push now going [Unai Bolivar - [`84efe24`](https://github.com/eea/volto-arcgis-block/commit/84efe24d964b79f54ddf17f69e389a3f57e3f867)]
428
431
  - CLMS-285178 (bug): Separated swipe from other tickets and can push [Unai Bolivar - [`3e94fd6`](https://github.com/eea/volto-arcgis-block/commit/3e94fd6d2f92817d6b0220155a7e8a0ed5d8dfdb)]
429
- - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`fdd39ce`](https://github.com/eea/volto-arcgis-block/commit/fdd39ce6c0d848b33f3b6d033e4b35e9bd4f2002)]
430
432
  ### [0.1.356](https://github.com/eea/volto-arcgis-block/compare/0.1.355...0.1.356) - 6 May 2025
431
433
 
432
434
  #### :hammer_and_wrench: Others
@@ -625,7 +627,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
625
627
 
626
628
  #### :house: Internal changes
627
629
 
628
- - chore: [JENKINSFILE] remove unused code [valentinab25 - [`c62af37`](https://github.com/eea/volto-arcgis-block/commit/c62af37e5c81f7b6b1d204de8a724499d00420d9)]
629
630
 
630
631
  #### :house: Documentation changes
631
632
 
@@ -944,13 +945,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
944
945
  #### :hammer_and_wrench: Others
945
946
 
946
947
  - CLMS-2916 (bug): Map Viewer / Products and Datasets tab / Layer - The information icon links to localhost in demo environment [Unai Bolivar - [`eda000a`](https://github.com/eea/volto-arcgis-block/commit/eda000a72278ab073033e520b868ded75dcc2904)]
947
- - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`8a0855d`](https://github.com/eea/volto-arcgis-block/commit/8a0855dfe47ec58a596ae0ec360ba8f8d075e991)]
948
- - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`3cfe9be`](https://github.com/eea/volto-arcgis-block/commit/3cfe9be4c6d4ace0ef83b452ebdd5b06025123aa)]
949
948
  ### [0.1.245](https://github.com/eea/volto-arcgis-block/compare/0.1.244...0.1.245) - 4 January 2024
950
949
 
951
950
  #### :hammer_and_wrench: Others
952
951
 
953
- - test: [JENKINS] fix jest config, fail with logs on coverage [valentinab25 - [`a93b081`](https://github.com/eea/volto-arcgis-block/commit/a93b0819eaa765c92bc25cf195f7a43fcd1dddbd)]
954
952
  ### [0.1.244](https://github.com/eea/volto-arcgis-block/compare/0.1.243...0.1.244) - 19 December 2023
955
953
 
956
954
  ### [0.1.243](https://github.com/eea/volto-arcgis-block/compare/0.1.242...0.1.243) - 15 December 2023
@@ -990,7 +988,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
990
988
 
991
989
  #### :hammer_and_wrench: Others
992
990
 
993
- - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`f45d4bf`](https://github.com/eea/volto-arcgis-block/commit/f45d4bf42061d13d9c18554bef692cb40b3a6fb7)]
994
991
  ### [0.1.235](https://github.com/eea/volto-arcgis-block/compare/0.1.234...0.1.235) - 16 November 2023
995
992
 
996
993
  ### [0.1.234](https://github.com/eea/volto-arcgis-block/compare/0.1.233...0.1.234) - 15 November 2023
@@ -2064,13 +2061,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2064
2061
  #### :hammer_and_wrench: Others
2065
2062
 
2066
2063
  - Merge pull request #148 from eea/develop [KCarpinteroBM - [`24266fb`](https://github.com/eea/volto-arcgis-block/commit/24266fb3a0c1662d22ae0529dc1d5a25c711cf97)]
2067
- - Revert "[JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`f751f69`](https://github.com/eea/volto-arcgis-block/commit/f751f69f652f0340ae55af6a4dab89d6bdc80906)]
2068
2064
  - Revert "Revert "Mapviewer menu and map viewer options persistence"" [Mikel Larreategi - [`ad6e440`](https://github.com/eea/volto-arcgis-block/commit/ad6e440cdc160cffb1e86e1b26e501dbe648476c)]
2069
2065
  - Revert "code coverage removal" [Mikel Larreategi - [`376f2d1`](https://github.com/eea/volto-arcgis-block/commit/376f2d1cd6e4e5110b3b63d5114af1bcfebe094b)]
2070
2066
  - Revert "Update cypress.json" [Mikel Larreategi - [`43d01a0`](https://github.com/eea/volto-arcgis-block/commit/43d01a0a95a58ef5215c6cbf18223ca30a11b9cc)]
2071
2067
  - Revert "Update cypress.json" [Mikel Larreategi - [`054c4ae`](https://github.com/eea/volto-arcgis-block/commit/054c4ae1767e1f26e6ec7e96a0e26a9711f29f04)]
2072
- - Revert "revert [JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`64ab56e`](https://github.com/eea/volto-arcgis-block/commit/64ab56e0f1f8dddc26f26039509a028e34653e64)]
2073
- - revert [JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967 [Mikel Larreategi - [`85ee194`](https://github.com/eea/volto-arcgis-block/commit/85ee1941e029df2b7dc910bf75231c75ffeca8c2)]
2074
2068
  - Update cypress.json [KCarpinteroBM - [`be285ff`](https://github.com/eea/volto-arcgis-block/commit/be285fff0c53e06a0180d5318cce81195eabcf80)]
2075
2069
  - Update cypress.json [KCarpinteroBM - [`a7f2118`](https://github.com/eea/volto-arcgis-block/commit/a7f2118acb7b048b4cef85aa9663c2244a1c9ca0)]
2076
2070
  - linting fix [KCarpinteroBM - [`27e969a`](https://github.com/eea/volto-arcgis-block/commit/27e969a7a411fd4646e0e742ce846efc0d79703e)]
@@ -2130,7 +2124,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2130
2124
  - UX improvements [rodriama - [`151dc4b`](https://github.com/eea/volto-arcgis-block/commit/151dc4b02d0a73fdd66de9d594620ac0fa5f1dbf)]
2131
2125
  - deleted failing tests [KCarpinteroBM - [`ddaa9e6`](https://github.com/eea/volto-arcgis-block/commit/ddaa9e6f06db6960a4c214d3be2420c48b26715d)]
2132
2126
  - cleaning unnecessary files [KCarpinteroBM - [`2c02199`](https://github.com/eea/volto-arcgis-block/commit/2c021990912beb02b603a1de89aecd62e0063769)]
2133
- - Reverting to Automated release 0.1.39 [KCarpinteroBM - [`fb9f317`](https://github.com/eea/volto-arcgis-block/commit/fb9f3176ccdea18fceb329eaac13ced0566ee648)]
2134
2127
  - commands added [KCarpinteroBM - [`049e60b`](https://github.com/eea/volto-arcgis-block/commit/049e60b7d124d1c05abd0b2775b510795f4ed59f)]
2135
2128
  - Mapviewer testing implementation [KCarpinteroBM - [`0103002`](https://github.com/eea/volto-arcgis-block/commit/0103002869eea108e16e3b5ff2e77a725dcc7c4b)]
2136
2129
  ### [0.1.39](https://github.com/eea/volto-arcgis-block/compare/0.1.38...0.1.39) - 24 March 2022
@@ -2150,7 +2143,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2150
2143
  - ESLint fix [rodriama - [`75dae9b`](https://github.com/eea/volto-arcgis-block/commit/75dae9b5bba18ab6d9624f6c99714b4bd2179003)]
2151
2144
  - Remove section title [rodriama - [`ece860e`](https://github.com/eea/volto-arcgis-block/commit/ece860eae3519c7e611abac16e8d53c9a9408b34)]
2152
2145
  - Es-Lint [manuelmartinezbilbomatica - [`39d8d11`](https://github.com/eea/volto-arcgis-block/commit/39d8d11b9096fd603df8510c119d2e12817415d6)]
2153
- - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`bf9f683`](https://github.com/eea/volto-arcgis-block/commit/bf9f683dd35a9edb4cfd9111affcb8f8edbeae89)]
2154
2146
  - FEAT: Parser Time implemented [manuelmartinezbilbomatica - [`689c99e`](https://github.com/eea/volto-arcgis-block/commit/689c99e55221fee6c7c7fafc4ab95ae7a646d3dd)]
2155
2147
  ### [0.1.38](https://github.com/eea/volto-arcgis-block/compare/0.1.37...0.1.38) - 18 March 2022
2156
2148
 
@@ -2245,7 +2237,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2245
2237
  - ESLint fix [rodriama - [`5fd3772`](https://github.com/eea/volto-arcgis-block/commit/5fd3772f197a3a380067962a5638dbf901a4624e)]
2246
2238
  - Pixel info [rodriama - [`1ccef39`](https://github.com/eea/volto-arcgis-block/commit/1ccef39a9adcc3ee94655c77a5a166b613600a08)]
2247
2239
  - NUTS bug fix [rodriama - [`37fe7f3`](https://github.com/eea/volto-arcgis-block/commit/37fe7f3fad2c005e3b7c234b3b0564d5df92fa8c)]
2248
- - Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`ea5af8b`](https://github.com/eea/volto-arcgis-block/commit/ea5af8b02a5f2ee25b9b0be67cf3792bbbe84ed7)]
2249
2240
  ### [0.1.23](https://github.com/eea/volto-arcgis-block/compare/0.1.22...0.1.23) - 17 December 2021
2250
2241
 
2251
2242
  #### :hammer_and_wrench: Others
@@ -2490,7 +2481,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2490
2481
  - Trying to delay ArcGIS modules load [gonzalezsd - [`ff16985`](https://github.com/eea/volto-arcgis-block/commit/ff169858e42d30bfcacc423ffc27762bb9ef05a4)]
2491
2482
  - Run bootstrap to fix files [valentinab25 - [`236893f`](https://github.com/eea/volto-arcgis-block/commit/236893f03314eb638b7667f81b1f91491a98ee17)]
2492
2483
  - fix git_name [valentinab25 - [`c7806c3`](https://github.com/eea/volto-arcgis-block/commit/c7806c312964425dc23e5d4c6973de8b81ddaeac)]
2493
- - Add Sonarqube tag using frontend addons list [EEA Jenkins - [`e3afb51`](https://github.com/eea/volto-arcgis-block/commit/e3afb515dda459ee03e2b5d4b56465d2d4ad1503)]
2494
2484
  - Trying to change imports [gonzalezsd - [`d83d7e2`](https://github.com/eea/volto-arcgis-block/commit/d83d7e2f68da4b2a284735847f93c0763a7e13b6)]
2495
2485
  - default design [bipoza - [`88fbe0b`](https://github.com/eea/volto-arcgis-block/commit/88fbe0b2bc73e732e2993324a567f53902e85506)]
2496
2486
  - cleanup of unused code [bipoza - [`b167677`](https://github.com/eea/volto-arcgis-block/commit/b1676771f637f056cad50cb0bc186f2ea79e8517)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.434",
3
+ "version": "0.1.436",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -65,6 +65,9 @@ class AreaWidget extends React.Component {
65
65
  this.addFeatureCollectionToMap = this.addFeatureCollectionToMap.bind(this);
66
66
  this.checkFeatureCount = this.checkFeatureCount.bind(this);
67
67
  this.prepackage = false;
68
+ this.isComponentMounted = false;
69
+ this.clickEventHandle = null;
70
+ this.dragEventContext = null;
68
71
  }
69
72
 
70
73
  loader() {
@@ -1348,6 +1351,7 @@ class AreaWidget extends React.Component {
1348
1351
  * This method is executed after the rener method is executed
1349
1352
  */
1350
1353
  async componentDidMount() {
1354
+ this.isComponentMounted = true;
1351
1355
  await this.loader();
1352
1356
  await this.initFMI();
1353
1357
  this.nutsGroupLayer = new GroupLayer({
@@ -1355,7 +1359,10 @@ class AreaWidget extends React.Component {
1355
1359
  //opacity: 0.5,
1356
1360
  });
1357
1361
  this.props.map.add(this.nutsGroupLayer);
1358
- this.props.view.on('click', (event) => {
1362
+ this.clickEventHandle = this.props.view.on('click', (event) => {
1363
+ if (!this.isComponentMounted) {
1364
+ return;
1365
+ }
1359
1366
  if (
1360
1367
  (this.props.mapViewer.activeWidget === this || this.props.download) &&
1361
1368
  (this.props.mapViewer.activeWidget
@@ -1397,9 +1404,12 @@ class AreaWidget extends React.Component {
1397
1404
  });
1398
1405
  this.props.uploadFileHandler(true);
1399
1406
  if (this.props.download) {
1400
- document.querySelector(
1407
+ let popupNode = document.querySelector(
1401
1408
  '.drawRectanglePopup-block',
1402
- ).style.display = 'none';
1409
+ );
1410
+ if (popupNode) {
1411
+ popupNode.style.display = 'none';
1412
+ }
1403
1413
  }
1404
1414
  }
1405
1415
  }
@@ -1408,23 +1418,47 @@ class AreaWidget extends React.Component {
1408
1418
  }
1409
1419
  });
1410
1420
  this.props.view.when(() => {
1421
+ if (!this.isComponentMounted || !this.props.view || !this.props.view.ui) {
1422
+ return;
1423
+ }
1411
1424
  this.props.download
1412
1425
  ? this.container !== null && this.props.view.ui.add(this.container)
1413
1426
  : this.container.current !== null &&
1414
1427
  this.props.view.ui.add(this.container.current, 'top-right');
1415
1428
 
1416
- var popup = document.createElement('div');
1417
- popup.className = 'drawRectanglePopup-block';
1418
- popup.innerHTML =
1419
- '<div className="drawRectanglePopup-content">' +
1420
- '<span className="drawRectanglePopup-icon"><span className="esri-icon-cursor-marquee"></span></span>' +
1421
- '<div className="drawRectanglePopup-text">Select or draw an area of interest in the map to continue</div>' +
1422
- '</div>';
1429
+ let popup = document.querySelector('.drawRectanglePopup-block');
1430
+ if (!popup) {
1431
+ popup = document.createElement('div');
1432
+ popup.className = 'drawRectanglePopup-block';
1433
+ popup.innerHTML =
1434
+ '<div className="drawRectanglePopup-content">' +
1435
+ '<span className="drawRectanglePopup-icon"><span className="esri-icon-cursor-marquee"></span></span>' +
1436
+ '<div className="drawRectanglePopup-text">Select or draw an area of interest in the map to continue</div>' +
1437
+ '</div>';
1438
+ }
1423
1439
  this.props.download && this.props.view.ui.add(popup, 'top-right');
1424
1440
  });
1425
1441
  this.dragElement(document.querySelector('.coordinateWindow'));
1426
1442
  }
1427
1443
 
1444
+ componentWillUnmount() {
1445
+ this.isComponentMounted = false;
1446
+ if (this.clickEventHandle && this.clickEventHandle.remove) {
1447
+ this.clickEventHandle.remove();
1448
+ this.clickEventHandle = null;
1449
+ }
1450
+ if (this.dragEventContext && this.dragEventContext.handleTarget) {
1451
+ this.dragEventContext.handleTarget.removeEventListener(
1452
+ 'mousedown',
1453
+ this.dragEventContext.handleEvent,
1454
+ );
1455
+ this.dragEventContext = null;
1456
+ }
1457
+ if (this.state.ShowGraphics && this.state.ShowGraphics.remove) {
1458
+ this.state.ShowGraphics.remove();
1459
+ }
1460
+ }
1461
+
1428
1462
  async initFMI() {
1429
1463
  let fetchUrl =
1430
1464
  window.location.href
@@ -1445,6 +1479,9 @@ class AreaWidget extends React.Component {
1445
1479
  }
1446
1480
  }
1447
1481
  dragElement(elmnt) {
1482
+ if (!elmnt) {
1483
+ return;
1484
+ }
1448
1485
  var pos1 = 0,
1449
1486
  pos2 = 0,
1450
1487
  pos3 = 0,
@@ -1470,10 +1507,25 @@ class AreaWidget extends React.Component {
1470
1507
  document.onmouseup = null;
1471
1508
  document.onmousemove = null;
1472
1509
  };
1510
+ if (this.dragEventContext && this.dragEventContext.handleTarget) {
1511
+ this.dragEventContext.handleTarget.removeEventListener(
1512
+ 'mousedown',
1513
+ this.dragEventContext.handleEvent,
1514
+ );
1515
+ this.dragEventContext = null;
1516
+ }
1473
1517
  if (header) {
1474
1518
  header.addEventListener('mousedown', dragMouseDown);
1519
+ this.dragEventContext = {
1520
+ handleTarget: header,
1521
+ handleEvent: dragMouseDown,
1522
+ };
1475
1523
  } else {
1476
1524
  elmnt.addEventListener('mousedown', dragMouseDown);
1525
+ this.dragEventContext = {
1526
+ handleTarget: elmnt,
1527
+ handleEvent: dragMouseDown,
1528
+ };
1477
1529
  }
1478
1530
  }
1479
1531
  /**
@@ -1354,7 +1354,7 @@ class BookmarkWidget extends React.Component {
1354
1354
  }}
1355
1355
  type="submit"
1356
1356
  >
1357
- <span class="esri-bookmarks__add-bookmark-icon esri-icon-plus"></span>
1357
+ <span className="esri-bookmarks__add-bookmark-icon esri-icon-plus"></span>
1358
1358
  Upload a bookmark
1359
1359
  </button>
1360
1360
  </div>
@@ -37,11 +37,17 @@ class LoadingSpinner extends React.Component {
37
37
  });
38
38
  const handle3 = this.props.view.on('layerview-create-error', (event) => {
39
39
  if (!this._isMounted) return;
40
- if (event.layer.loadError !== null && this.state.loading === true) {
40
+ if (this.state.loading === true) {
41
41
  this.setState({ loading: false }, this.showLoading);
42
42
  }
43
43
  });
44
- this.arcgisEventHandles.push(handle1, handle2, handle3);
44
+ const handle4 = this.props.view.watch('updating', (isUpdating) => {
45
+ if (!this._isMounted) return;
46
+ if (!isUpdating && this.state.loading === true) {
47
+ this.setState({ loading: false }, this.showLoading);
48
+ }
49
+ });
50
+ this.arcgisEventHandles.push(handle1, handle2, handle3, handle4);
45
51
  }
46
52
 
47
53
  showLoading() {
@@ -386,6 +386,7 @@ class MapViewer extends React.Component {
386
386
  this.isViewModeButtonLoaded = false;
387
387
  this.viewUiOperationState = null;
388
388
  this.shouldClearSessionOnUnmount = true;
389
+ this.uploadErrorTimeoutTask = null;
389
390
  this.scheduleViewModeButtonLoad = this.scheduleViewModeButtonLoad.bind(
390
391
  this,
391
392
  );
@@ -645,7 +646,24 @@ class MapViewer extends React.Component {
645
646
  const containerNodeList = document.querySelectorAll(selector);
646
647
  if (!containerNodeList || containerNodeList.length === 0) return;
647
648
  containerNodeList.forEach((containerNode) => {
648
- if (!containerNode) return;
649
+ if (!containerNode || !containerNode.isConnected) return;
650
+ if (!containerNode.__mapViewerContainerParentNode) {
651
+ const containerParentNode = containerNode.parentNode;
652
+ const isUiContainerParent =
653
+ containerParentNode &&
654
+ containerParentNode.classList &&
655
+ (containerParentNode.classList.contains(
656
+ 'esri-ui-inner-container',
657
+ ) ||
658
+ containerParentNode.classList.contains('esri-ui-corner') ||
659
+ containerParentNode.classList.contains('esri-ui-top-left') ||
660
+ containerParentNode.classList.contains('esri-ui-top-right') ||
661
+ containerParentNode.classList.contains('esri-ui-bottom-left') ||
662
+ containerParentNode.classList.contains('esri-ui-bottom-right'));
663
+ containerNode.__mapViewerContainerParentNode = isUiContainerParent
664
+ ? this.mapContainer.current
665
+ : containerParentNode;
666
+ }
649
667
  try {
650
668
  this.view.ui.add(containerNode, position);
651
669
  } catch (error) {}
@@ -673,6 +691,7 @@ class MapViewer extends React.Component {
673
691
  this.isViewSwitchInProgress ||
674
692
  !this.state.isWidgetRenderEnabled
675
693
  ) {
694
+ this.syncViewTask = null;
676
695
  return;
677
696
  }
678
697
  this.syncViewWidgetContainers();
@@ -713,7 +732,8 @@ class MapViewer extends React.Component {
713
732
  const resolveWidgetParentNode = (widgetNode) => {
714
733
  if (
715
734
  widgetNode &&
716
- widgetNode.__mapViewerContainerParentNode instanceof Node
735
+ widgetNode.__mapViewerContainerParentNode instanceof Node &&
736
+ widgetNode.__mapViewerContainerParentNode.isConnected
717
737
  ) {
718
738
  return widgetNode.__mapViewerContainerParentNode;
719
739
  }
@@ -1305,8 +1325,16 @@ class MapViewer extends React.Component {
1305
1325
 
1306
1326
  uploadFileErrorHandler = (errorType = 'uploadError') => {
1307
1327
  this.setState({ uploadError: true, uploadErrorType: errorType });
1308
- setTimeout(() => {
1328
+ if (this.uploadErrorTimeoutTask) {
1329
+ clearTimeout(this.uploadErrorTimeoutTask);
1330
+ this.uploadErrorTimeoutTask = null;
1331
+ }
1332
+ this.uploadErrorTimeoutTask = setTimeout(() => {
1333
+ if (!this.isComponentMounted) {
1334
+ return;
1335
+ }
1309
1336
  this.setState({ uploadError: false, uploadErrorType: 'uploadError' });
1337
+ this.uploadErrorTimeoutTask = null;
1310
1338
  }, 3000);
1311
1339
  };
1312
1340
 
@@ -1459,6 +1487,7 @@ class MapViewer extends React.Component {
1459
1487
 
1460
1488
  componentDidUpdate(prevProps, prevState) {
1461
1489
  // Handle Download/dataset URL changes (existing logic)
1490
+ this.scheduleViewModeButtonLoad();
1462
1491
  if (
1463
1492
  this.props.Download ||
1464
1493
  (this.location &&
@@ -1518,6 +1547,11 @@ class MapViewer extends React.Component {
1518
1547
  this.viewModeButtonTimeout = null;
1519
1548
  }
1520
1549
 
1550
+ if (this.uploadErrorTimeoutTask) {
1551
+ clearTimeout(this.uploadErrorTimeoutTask);
1552
+ this.uploadErrorTimeoutTask = null;
1553
+ }
1554
+
1521
1555
  window.removeEventListener('beforeunload', this.handlePageUnload);
1522
1556
  window.removeEventListener('pagehide', this.handlePageUnload);
1523
1557
  document.removeEventListener(
@@ -1848,13 +1882,25 @@ class MapViewer extends React.Component {
1848
1882
  // DOM element to be mounted (but not yet mounted)
1849
1883
  if ('loading' in this.props.mapviewer_config) {
1850
1884
  return (
1851
- <div ref={this.mapContainer} className={this.mapClass}>
1885
+ <div
1886
+ ref={this.mapContainer}
1887
+ className={classNames(
1888
+ this.mapClass,
1889
+ `view-mode-${this.state.viewMode}`,
1890
+ )}
1891
+ >
1852
1892
  <div ref={this.mapdiv} className="map" />
1853
1893
  </div>
1854
1894
  );
1855
1895
  } else {
1856
1896
  return (
1857
- <div ref={this.mapContainer} className={this.mapClass}>
1897
+ <div
1898
+ ref={this.mapContainer}
1899
+ className={classNames(
1900
+ this.mapClass,
1901
+ `view-mode-${this.state.viewMode}`,
1902
+ )}
1903
+ >
1858
1904
  <div ref={this.mapdiv} className="map" />
1859
1905
  {this.appLanguage()}
1860
1906
  {this.state.isWidgetRenderEnabled && (
@@ -63,7 +63,7 @@ class MeasurementWidget extends React.Component {
63
63
  // and ensure that the component is rendered again
64
64
  this.setState({ showMapMenu: false });
65
65
  this.toggleDropdownContent();
66
- this.clearMeasurements();
66
+ this.clearMeasurements(false);
67
67
  this.clearCoordinates();
68
68
  } else {
69
69
  this.props.mapViewer.setActiveWidget(this);
@@ -133,7 +133,7 @@ class MeasurementWidget extends React.Component {
133
133
  );
134
134
  }
135
135
  this.toggleDropdownContent(e);
136
- this.clearMeasurements();
136
+ this.clearMeasurements(false);
137
137
  this.clearCoordinates();
138
138
  if (e.currentTarget.getAttribute('aria-expanded') === 'true') {
139
139
  this.areaMeasurement();
@@ -147,7 +147,7 @@ class MeasurementWidget extends React.Component {
147
147
  );
148
148
  }
149
149
  this.toggleDropdownContent(e);
150
- this.clearMeasurements();
150
+ this.clearMeasurements(false);
151
151
  this.clearCoordinates();
152
152
  if (e.currentTarget.getAttribute('aria-expanded') === 'true') {
153
153
  this.distanceMeasurement();
@@ -156,7 +156,7 @@ class MeasurementWidget extends React.Component {
156
156
 
157
157
  coordsMeasurementHandler(e) {
158
158
  this.toggleDropdownContent(e);
159
- this.clearMeasurements();
159
+ this.clearMeasurements(false);
160
160
  //*** Add event to show mouse coordinates on click and move ***//
161
161
  var getCoordinates = this.props.view.on(
162
162
  ['pointer-down', 'pointer-move'],
@@ -171,6 +171,9 @@ class MeasurementWidget extends React.Component {
171
171
 
172
172
  areaMeasurement() {
173
173
  if (this.isThreeDimensionalView()) {
174
+ if (!this.areaMeasurementWidget || !this.distanceMeasurementWidget) {
175
+ this.initializeThreeDimensionalMeasurements();
176
+ }
174
177
  if (this.areaMeasurementWidget) {
175
178
  this.areaMeasurementWidget.visible = true;
176
179
  }
@@ -187,6 +190,9 @@ class MeasurementWidget extends React.Component {
187
190
 
188
191
  distanceMeasurement() {
189
192
  if (this.isThreeDimensionalView()) {
193
+ if (!this.areaMeasurementWidget || !this.distanceMeasurementWidget) {
194
+ this.initializeThreeDimensionalMeasurements();
195
+ }
190
196
  if (this.distanceMeasurementWidget) {
191
197
  this.distanceMeasurementWidget.visible = true;
192
198
  }
@@ -201,7 +207,7 @@ class MeasurementWidget extends React.Component {
201
207
  }
202
208
  }
203
209
 
204
- clearMeasurements() {
210
+ clearMeasurements(shouldDestroyThreeDimensionalMeasurements = false) {
205
211
  if (this.measurement && this.measurement.clear) {
206
212
  this.measurement.clear();
207
213
  }
@@ -216,9 +222,91 @@ class MeasurementWidget extends React.Component {
216
222
  this.distanceMeasurementWidget.clear();
217
223
  this.distanceMeasurementWidget.visible = false;
218
224
  }
225
+ if (this.isThreeDimensionalView()) {
226
+ this.resetThreeDimensionalMeasurementState();
227
+ }
228
+ if (
229
+ this.isThreeDimensionalView() &&
230
+ shouldDestroyThreeDimensionalMeasurements
231
+ ) {
232
+ this.destroyThreeDimensionalMeasurements();
233
+ }
234
+ }
235
+
236
+ resetThreeDimensionalMeasurementState() {
237
+ const widgetList = [
238
+ this.areaMeasurementWidget,
239
+ this.distanceMeasurementWidget,
240
+ ];
241
+
242
+ widgetList.forEach((widget) => {
243
+ if (!widget) return;
244
+
245
+ if (widget.viewModel && widget.viewModel.newMeasurement) {
246
+ widget.viewModel.newMeasurement();
247
+ }
248
+ if (widget.viewModel && widget.viewModel.clear) {
249
+ widget.viewModel.clear();
250
+ }
251
+ if (widget.clear) {
252
+ widget.clear();
253
+ }
254
+ widget.visible = false;
255
+ });
256
+ }
257
+
258
+ initializeThreeDimensionalMeasurements() {
259
+ if (
260
+ !this.container.current ||
261
+ !this.props.view ||
262
+ !this.isThreeDimensionalView()
263
+ ) {
264
+ return;
265
+ }
266
+
267
+ if (!this.areaMeasurementWidget) {
268
+ this.areaMeasurementWidget = new AreaMeasurement3D({
269
+ view: this.props.view,
270
+ container: this.container.current.querySelector('.measurement-area'),
271
+ });
272
+ this.areaMeasurementWidget.visible = false;
273
+ }
274
+
275
+ if (!this.distanceMeasurementWidget) {
276
+ this.distanceMeasurementWidget = new DirectLineMeasurement3D({
277
+ view: this.props.view,
278
+ container: this.container.current.querySelector(
279
+ '.measurement-distance',
280
+ ),
281
+ });
282
+ this.distanceMeasurementWidget.visible = false;
283
+ }
284
+ }
285
+
286
+ destroyThreeDimensionalMeasurements() {
287
+ if (this.areaMeasurementWidget && this.areaMeasurementWidget.destroy) {
288
+ this.areaMeasurementWidget.destroy();
289
+ this.areaMeasurementWidget = null;
290
+ }
291
+ if (
292
+ this.distanceMeasurementWidget &&
293
+ this.distanceMeasurementWidget.destroy
294
+ ) {
295
+ this.distanceMeasurementWidget.destroy();
296
+ this.distanceMeasurementWidget = null;
297
+ }
219
298
  }
220
299
 
221
300
  showCoordinates(pt) {
301
+ if (
302
+ !pt ||
303
+ typeof pt.latitude !== 'number' ||
304
+ typeof pt.longitude !== 'number'
305
+ ) {
306
+ this.setState({ latlong: false });
307
+ return;
308
+ }
309
+
222
310
  this.setState({
223
311
  latlong: { x: pt.latitude.toFixed(4), y: pt.longitude.toFixed(4) },
224
312
  });
@@ -243,19 +331,7 @@ class MeasurementWidget extends React.Component {
243
331
  this.props.view.ui.add(this.container.current, 'top-right');
244
332
 
245
333
  if (this.isThreeDimensionalView()) {
246
- this.areaMeasurementWidget = new AreaMeasurement3D({
247
- view: this.props.view,
248
- container: this.container.current.querySelector('.measurement-area'),
249
- });
250
- this.areaMeasurementWidget.visible = false;
251
-
252
- this.distanceMeasurementWidget = new DirectLineMeasurement3D({
253
- view: this.props.view,
254
- container: this.container.current.querySelector(
255
- '.measurement-distance',
256
- ),
257
- });
258
- this.distanceMeasurementWidget.visible = false;
334
+ this.initializeThreeDimensionalMeasurements();
259
335
  } else {
260
336
  this.measurement = new Measurement({
261
337
  view: this.props.view,
@@ -272,15 +348,7 @@ class MeasurementWidget extends React.Component {
272
348
  if (this.measurement && this.measurement.destroy) {
273
349
  this.measurement.destroy();
274
350
  }
275
- if (this.areaMeasurementWidget && this.areaMeasurementWidget.destroy) {
276
- this.areaMeasurementWidget.destroy();
277
- }
278
- if (
279
- this.distanceMeasurementWidget &&
280
- this.distanceMeasurementWidget.destroy
281
- ) {
282
- this.distanceMeasurementWidget.destroy();
283
- }
351
+ this.destroyThreeDimensionalMeasurements();
284
352
  }
285
353
  /**
286
354
  * This method renders the component
@@ -3583,6 +3583,35 @@ class MenuWidget extends React.Component {
3583
3583
  resourceLayer.ViewService = (viewService || '').trim();
3584
3584
  }
3585
3585
 
3586
+ const isSceneUploadValidation =
3587
+ this.view &&
3588
+ this.view.type === '3d' &&
3589
+ (serviceType === 'WMS' || serviceType === 'WMTS');
3590
+
3591
+ if (isSceneUploadValidation) {
3592
+ try {
3593
+ this.map.add(resourceLayer);
3594
+ await this.view.whenLayerView(resourceLayer);
3595
+ } catch (error) {
3596
+ try {
3597
+ if (this.map.findLayerById(resourceLayer.id)) {
3598
+ this.map.remove(resourceLayer);
3599
+ }
3600
+ } catch (e) {}
3601
+ if (this.isSceneTilingError(error)) {
3602
+ this.props.uploadFileErrorHandler('sceneViewTilingError');
3603
+ continue;
3604
+ }
3605
+ throw error;
3606
+ }
3607
+
3608
+ try {
3609
+ if (this.map.findLayerById(resourceLayer.id)) {
3610
+ this.map.remove(resourceLayer);
3611
+ }
3612
+ } catch (e) {}
3613
+ }
3614
+
3586
3615
  const layerSignatureData = `${(
3587
3616
  resourceLayer.ViewService || ''
3588
3617
  ).trim()}::${resourceLayer.LayerId}`;
@@ -3897,6 +3926,14 @@ class MenuWidget extends React.Component {
3897
3926
  const checkedLayers =
3898
3927
  JSON.parse(sessionStorage.getItem('checkedLayers')) || [];
3899
3928
  const isChecked = checkedLayers.includes(layer.LayerId);
3929
+ const serviceType =
3930
+ layer.type === 'wmts'
3931
+ ? 'WMTS'
3932
+ : layer.type === 'wms'
3933
+ ? 'WMS'
3934
+ : layer.type === 'geojson'
3935
+ ? 'WFS'
3936
+ : 'WMS';
3900
3937
 
3901
3938
  // Create a simplified object for storage
3902
3939
  return {
@@ -3918,9 +3955,18 @@ class MenuWidget extends React.Component {
3918
3955
  })),
3919
3956
  ViewService: layer.ViewService,
3920
3957
  LayerId: layer.LayerId,
3958
+ serviceType: serviceType,
3959
+ activeLayer:
3960
+ serviceType === 'WMTS' && layer.activeLayer
3961
+ ? {
3962
+ id: layer.activeLayer.id,
3963
+ title: layer.activeLayer.title,
3964
+ tileMatrixSetId: layer.activeLayer.tileMatrixSetId,
3965
+ }
3966
+ : null,
3921
3967
  visibility: layer.visible !== false,
3922
3968
  opacity: layer.opacity || 1,
3923
- checked: isChecked || layer.checked || false,
3969
+ checked: isChecked,
3924
3970
  };
3925
3971
  });
3926
3972
 
@@ -3941,26 +3987,65 @@ class MenuWidget extends React.Component {
3941
3987
  if (savedServices && Array.isArray(savedServices)) {
3942
3988
  // Process saved services to recreate actual layer objects
3943
3989
  const recreatedLayers = await Promise.all(
3944
- savedServices.map(async (serviceData) => {
3990
+ savedServices.map(async (serviceData, serviceIndex) => {
3945
3991
  try {
3946
- // Create a new WMSLayer with the saved properties
3947
- const newLayer = new WMSLayer(serviceData);
3992
+ const resolveServiceType =
3993
+ serviceData.serviceType ||
3994
+ (typeof serviceData.ViewService === 'string' &&
3995
+ serviceData.ViewService.toLowerCase().includes('wmts')
3996
+ ? 'WMTS'
3997
+ : 'WMS');
3998
+ const resolvedLayerId =
3999
+ serviceData.LayerId ||
4000
+ serviceData.id ||
4001
+ `user_service_${serviceIndex}`;
4002
+ const newLayer =
4003
+ resolveServiceType === 'WMTS'
4004
+ ? new WMTSLayer({
4005
+ id: resolvedLayerId,
4006
+ url: serviceData.url || serviceData.ViewService,
4007
+ title: serviceData.title || '',
4008
+ spatialReference: this.view?.spatialReference,
4009
+ serviceMode: 'KVP',
4010
+ activeLayer: serviceData.activeLayer || undefined,
4011
+ ViewService:
4012
+ serviceData.ViewService || serviceData.url || '',
4013
+ })
4014
+ : new WMSLayer({
4015
+ id: resolvedLayerId,
4016
+ url: serviceData.url || serviceData.ViewService,
4017
+ featureInfoFormat:
4018
+ serviceData.featureInfoFormat || 'text/html',
4019
+ featureInfoUrl:
4020
+ serviceData.featureInfoUrl ||
4021
+ serviceData.url ||
4022
+ serviceData.ViewService,
4023
+ title: serviceData.title || '',
4024
+ legendEnabled: serviceData.legendEnabled,
4025
+ sublayers: serviceData.sublayers,
4026
+ ViewService:
4027
+ serviceData.ViewService || serviceData.url || '',
4028
+ });
3948
4029
 
3949
4030
  // Set visibility property based on saved value
3950
4031
  newLayer.visible = serviceData.visibility !== false;
4032
+ newLayer.LayerId = resolvedLayerId;
4033
+ if (serviceData.description) {
4034
+ newLayer.description = serviceData.description;
4035
+ }
3951
4036
 
3952
4037
  // Remember the original checked state and visibility
3953
4038
  newLayer.checked = serviceData.checked;
3954
4039
 
3955
4040
  // Initialize visibleLayers for this layer
3956
4041
  if (!this.visibleLayers) this.visibleLayers = {};
3957
- this.visibleLayers[serviceData.LayerId] =
4042
+ this.visibleLayers[resolvedLayerId] =
3958
4043
  serviceData.visibility !== false
3959
4044
  ? ['fas', 'eye']
3960
4045
  : ['fas', 'eye-slash'];
3961
4046
 
3962
4047
  // Add to this.layers
3963
- this.layers[serviceData.LayerId] = newLayer;
4048
+ this.layers[resolvedLayerId] = newLayer;
3964
4049
  return newLayer;
3965
4050
  } catch (error) {
3966
4051
  return null;
@@ -3995,9 +4080,11 @@ class MenuWidget extends React.Component {
3995
4080
 
3996
4081
  // Then check the checkbox and call toggleLayer with a flag to preserve visibility
3997
4082
  node.checked = true;
4083
+ node.dataset.preserveCheckedLayerState = 'true';
3998
4084
 
3999
4085
  // Custom addition to toggleLayer to bypass visibility override
4000
4086
  this.toggleLayerWithoutVisibilityReset(node);
4087
+ delete node.dataset.preserveCheckedLayerState;
4001
4088
  }
4002
4089
  }
4003
4090
  });
@@ -4264,6 +4351,8 @@ class MenuWidget extends React.Component {
4264
4351
  this.state.wmsUserServiceLayers.find(
4265
4352
  (layer) => layer.LayerId === elem.id,
4266
4353
  ) || null;
4354
+ const preserveCheckedLayerState =
4355
+ elem.dataset && elem.dataset.preserveCheckedLayerState === 'true';
4267
4356
  if (elem.checked && !userService) {
4268
4357
  this.findCheckedDatasetNoServiceToVisualize(elem);
4269
4358
  }
@@ -4284,7 +4373,9 @@ class MenuWidget extends React.Component {
4284
4373
  if (!canApplyWmtsSettings) {
4285
4374
  elem.checked = false;
4286
4375
  this.layers[elem.id].visible = false;
4287
- this.deleteCheckedLayer(elem.id);
4376
+ if (!preserveCheckedLayerState) {
4377
+ this.deleteCheckedLayer(elem.id);
4378
+ }
4288
4379
  delete this.activeLayersJSON[elem.id];
4289
4380
  if (this.visibleLayers) {
4290
4381
  delete this.visibleLayers[elem.id];
@@ -4303,7 +4394,9 @@ class MenuWidget extends React.Component {
4303
4394
  try {
4304
4395
  await this.layers[elem.id].load();
4305
4396
  } catch (error) {
4306
- this.processUnsupportedWmtsLayer(elem);
4397
+ this.processUnsupportedWmtsLayer(elem, {
4398
+ preserveCheckedLayerState,
4399
+ });
4307
4400
  return;
4308
4401
  }
4309
4402
  }
@@ -4400,7 +4493,9 @@ class MenuWidget extends React.Component {
4400
4493
  try {
4401
4494
  await this.view.whenLayerView(this.layers[elem.id]);
4402
4495
  } catch (error) {
4403
- this.processUnsupportedWmtsLayer(elem);
4496
+ this.processUnsupportedWmtsLayer(elem, {
4497
+ preserveCheckedLayerState,
4498
+ });
4404
4499
  return;
4405
4500
  }
4406
4501
  }
@@ -4539,13 +4634,16 @@ class MenuWidget extends React.Component {
4539
4634
  this.url = null;
4540
4635
  }
4541
4636
 
4542
- processUnsupportedWmtsLayer(elem) {
4637
+ processUnsupportedWmtsLayer(elem, options = {}) {
4638
+ const { preserveCheckedLayerState = false } = options;
4543
4639
  if (!elem || !this.layers || !this.layers[elem.id]) {
4544
4640
  return;
4545
4641
  }
4546
4642
  elem.checked = false;
4547
4643
  this.layers[elem.id].visible = false;
4548
- this.deleteCheckedLayer(elem.id);
4644
+ if (!preserveCheckedLayerState) {
4645
+ this.deleteCheckedLayer(elem.id);
4646
+ }
4549
4647
  const mapLayer = this.map ? this.map.findLayerById(elem.id) : null;
4550
4648
  if (mapLayer) {
4551
4649
  try {
@@ -6906,7 +7004,9 @@ class MenuWidget extends React.Component {
6906
7004
  const node = document.getElementById(layer.LayerId);
6907
7005
  if (node) {
6908
7006
  node.checked = true;
7007
+ node.dataset.preserveCheckedLayerState = 'true';
6909
7008
  this.toggleLayer(node);
7009
+ delete node.dataset.preserveCheckedLayerState;
6910
7010
  }
6911
7011
  }
6912
7012
  });
@@ -7333,6 +7433,9 @@ class MenuWidget extends React.Component {
7333
7433
  for (var i = layers.length - 1; i >= 0; i--) {
7334
7434
  let layer = layers[i];
7335
7435
  let node = document.getElementById(layer);
7436
+ const restoreLayerState = this.state.wmsUserServiceLayers.some(
7437
+ (serviceLayer) => serviceLayer.LayerId === layer,
7438
+ );
7336
7439
 
7337
7440
  if (node) {
7338
7441
  if (!node.checked) {
@@ -7340,7 +7443,13 @@ class MenuWidget extends React.Component {
7340
7443
  // click event fires toggleLayer()
7341
7444
  //node.dispatchEvent(event);
7342
7445
  node.checked = true;
7446
+ if (restoreLayerState) {
7447
+ node.dataset.preserveCheckedLayerState = 'true';
7448
+ }
7343
7449
  this.toggleLayer(node);
7450
+ if (restoreLayerState) {
7451
+ delete node.dataset.preserveCheckedLayerState;
7452
+ }
7344
7453
  }
7345
7454
 
7346
7455
  // set scroll position
@@ -49,6 +49,14 @@
49
49
  z-index: 1;
50
50
  }
51
51
 
52
+ .esri-ui-top-left.esri-ui-corner {
53
+ margin-top: 0.5rem !important;
54
+ }
55
+
56
+ .map-container.view-mode-3d .esri-ui-top-left.esri-ui-corner {
57
+ margin-top: 0 !important;
58
+ }
59
+
52
60
  .esri-component.esri-zoom.esri-widget {
53
61
  background: none;
54
62
  box-shadow: none;