Skip to content

#12000: fix CRS Selector configuration is not persisted#12012

Merged
subashtiwari1010 merged 3 commits intogeosolutions-it:masterfrom
mahmoudadel54:issue_12000
Mar 2, 2026
Merged

#12000: fix CRS Selector configuration is not persisted#12012
subashtiwari1010 merged 3 commits intogeosolutions-it:masterfrom
mahmoudadel54:issue_12000

Conversation

@mahmoudadel54
Copy link
Copy Markdown
Contributor

Description

This PR fixes CRS Selector configuration is not persisted for context's maps.
The fix includes:

  • fix non persistence crs selector for create maps from context by Import CRSSelector plugin synchronously
  • handle lazy loading for render AvailableProjections comp in CRSSelector to improve performance to load on-demand via React.lazy

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?

#12000

What is the new behavior?

recording.7.mp4

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

for test:
in localConfig.json add 'projectionDefs'

"projectionDefs": [ {
            "code": "EPSG:32122",
            "def": "+proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
            "extent": [
                403035.4105968763,
                48133.91598795739,
                769684.5675940284,
                298304.0075010298
            ],
            "worldExtent": [
                -84.809194047635,
                40.076629775274405,
                -80.4412897899362,
                42.33467076175862
            ]
        },
        {
            "code": "EPSG:2154",
            "def": "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
            "extent": [
                -378305.81,
                6093283.21,
                1212610.74,
                7186901.68
            ],
            "worldExtent": [
                -9.86,
                41.15,
                10.38,
                51.56
            ]
        },
        {
            "code": "EPSG:3942",
            "def": "+proj=lcc +lat_1=41.25 +lat_2=42.75 +lat_0=42 +lon_0=3 +x_0=1700000 +y_0=1200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
            "extent": [
                624506.09,
                1186515.84,
                2218708.44,
                2290184.5
            ],
            "worldExtent": [
                -9.86,
                41.15,
                10.38,
                51.56
            ]
        },
        {
            "code": "EPSG:3943",
            "def": "+proj=lcc +lat_1=42.25 +lat_2=43.75 +lat_0=43 +lon_0=3 +x_0=1700000 +y_0=2200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
            "extent": [
                624227.05,
                2076993.88,
                2217136.99,
                3178000.51
            ],
            "worldExtent": [
                -9.86,
                41.15,
                10.38,
                51.56
            ]
        },
        {
            "code": "EPSG:3944",
            "def": "+proj=lcc +lat_1=43.25 +lat_2=44.75 +lat_0=44 +lon_0=3 +x_0=1700000 +y_0=3200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
            "extent": [
                623631.35,
                2967391.61,
                2215750.35,
                4066109.53
            ],
            "worldExtent": [
                -9.86,
                41.15,
                10.38,
                51.56
            ]
        },
        {
            "code": "EPSG:3945",
            "def": "+proj=lcc +lat_1=44.25 +lat_2=45.75 +lat_0=45 +lon_0=3 +x_0=1700000 +y_0=4200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
            "extent": [
                622723.91,
                3857676.97,
                2214544.93,
                4954472.7
            ],
            "worldExtent": [
                -9.86,
                41.15,
                10.38,
                51.56
            ]
        },
        {
            "code": "EPSG:3946",
            "def": "+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
            "extent": [
                621509.63,
                4747818.41,
                2213517.21,
                5843051.8
            ],
            "worldExtent": [
                -9.86,
                41.15,
                10.38,
                51.56
            ]
        },
        {
            "code": "EPSG:3947",
            "def": "+proj=lcc +lat_1=46.25 +lat_2=47.75 +lat_0=47 +lon_0=3 +x_0=1700000 +y_0=6200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
            "extent": [
                619993.48,
                5637784.91,
                2212663.72,
                6731809.22
            ],
            "worldExtent": [
                -9.86,
                41.15,
                10.38,
                51.56
            ]
        },
        {
            "code": "EPSG:3948",
            "def": "+proj=lcc +lat_1=47.25 +lat_2=48.75 +lat_0=48 +lon_0=3 +x_0=1700000 +y_0=7200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
            "extent": [
                618180.54,
                6527546.03,
                2211981.05,
                7620707.95
            ],
            "worldExtent": [
                -9.86,
                41.15,
                10.38,
                51.56
            ]
        },
        {
            "code": "EPSG:3949",
            "def": "+proj=lcc +lat_1=48.25 +lat_2=49.75 +lat_0=49 +lon_0=3 +x_0=1700000 +y_0=8200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
            "extent": [
                616075.94,
                7417071.95,
                2211465.79,
                8509711.64
            ],
            "worldExtent": [
                -9.86,
                41.15,
                10.38,
                51.56
            ]
        },
        {
            "code": "EPSG:3950",
            "def": "+proj=lcc +lat_1=49.25 +lat_2=50.75 +lat_0=50 +lon_0=3 +x_0=1700000 +y_0=9200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
            "extent": [
                613684.96,
                8306333.45,
                2211114.59,
                9398784.57
            ],
            "worldExtent": [
                -9.86,
                41.15,
                10.38,
                51.56
            ]
        },
        {
            "code": "EPSG:32619",
            "def": "+proj=utm +zone=19 +datum=WGS84 +units=m +no_defs +type=crs",
            "extent": [
                166021.44,
                0.0,
                833978.56,
                9329005.18
            ],
            "worldExtent": [
                -72.0,
                0.0,
                -66.0,
                84.0
            ]
        },
        {
            "code": "EPSG:32636",
            "def": "+proj=utm +zone=36 +datum=WGS84 +units=m +no_defs +type=crs",
            "extent": [
                166021.44,
                0.0,
                833978.56,
                9329005.18
            ],
            "worldExtent": [
                30.0,
                0.0,
                36.0,
                84.0
            ]
        },
        {
            "code": "EPSG:32632",
            "def": "+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs +type=crs",
            "extent": [
                166021.44,
                0.0,
                833978.56,
                9329005.18
            ],
            "worldExtent": [
                6.0,
                0.0,
                12.0,
                84.0
            ]
        },
        {
            "code": "EPSG:7791",
            "def": "+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs",
            "extent": [
                218994.5,
                3846433.22,
                1415881.28,
                5264909.36
            ],
            "worldExtent": [
                5.93,
                34.76,
                18.99,
                47.1
            ]
        },
        {
            "code": "EPSG:3878",
            "def": "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=24500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs",
            "extent": [
                2.063360428E7,
                3639745.74,
                2.60223445E7,
                9551197.96
            ],
            "worldExtent": [
                -16.1,
                32.88,
                40.18,
                84.73
            ]
        },
        {
            "code": "EPSG:25830",
            "def": "+proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs",
            "extent": [
                -729785.76,
                3638026.2,
                4677582.63,
                9568350.48
            ],
            "worldExtent": [
                -16.1,
                32.88,
                40.18,
                84.73
            ]
        },
        {
            "code": "EPSG:3003",
            "def": "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y_0=0 +ellps=intl +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68 +units=m +no_defs +type=crs",
            "extent": [
                1290650.93,
                4190305.78,
                2343702.24,
                5261004.57
            ],
            "worldExtent": [
                6.62,
                37.86,
                18.58,
                47.1
            ]
        }],

- fix non persistence crs selector for create maps from context by Import CRSSelector plugin synchronously
- handle lazy loading for render AvailableProjections comp in CRSSelector to improve performance to load on-demand via React.lazy
@mahmoudadel54 mahmoudadel54 added this to the 2026.01.00 milestone Feb 23, 2026
@mahmoudadel54 mahmoudadel54 requested a review from MV88 February 23, 2026 15:00
@mahmoudadel54 mahmoudadel54 self-assigned this Feb 23, 2026
@cla-bot cla-bot Bot added the CLA Ready label Feb 23, 2026
@mahmoudadel54 mahmoudadel54 linked an issue Feb 23, 2026 that may be closed by this pull request
@allyoucanmap allyoucanmap removed the request for review from MV88 February 25, 2026 14:17
Copy link
Copy Markdown
Contributor

@subashtiwari1010 subashtiwari1010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mahmoudadel54
Found a issue in the CRS selector:

  • Create a new map
  • Open the CRS modal
  • Select some CRS and save it
  • Go to Home
  • Go to create a new map again
  • Open the CRS modal
  • Previous selector is still checked for the new map too

Implementation needed:

  • For the new map, the CRS selector modal should be fresh without previous selections

…ifferent maps

- handle reset selector when creating a new map and when opening existing maps
- edit unit tests for crsselector
@subashtiwari1010
Copy link
Copy Markdown
Contributor

@mahmoudadel54
After selecting other CRS than EPSG:4326, saving, refreshing and then opening the CRS selector modal, always the first option is selected (EPSG:4326). The CRS selector modal should always display the current CRS rather than always showing the first CRS as selected.

Steps to reproduce issue:

  • Open a new map
  • Go to the CRS selector modal, and select any other CRS as current CRS than EPSG:4326
  • Save the CRS and the map
  • Reload the page
  • Open the CRS selector modal
  • Check the selected CRS in modal (It always selects EPSG:4326 as selected)

Expected result:

The CRS selector modal should always display the current selected CRS.

@subashtiwari1010 subashtiwari1010 merged commit 2c2f099 into geosolutions-it:master Mar 2, 2026
12 checks passed
@offtherailz
Copy link
Copy Markdown
Member

Successfully created backport PR for 2026.01.xx:

@subashtiwari1010
Copy link
Copy Markdown
Contributor

@ElenaGallo please test this fix on dev, thanks

tdipisa pushed a commit that referenced this pull request Mar 11, 2026
(cherry picked from commit 2c2f099)

Co-authored-by: mahmoud adel <58145645+mahmoudadel54@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CRS Selector configuration is not persisted

5 participants