Description
When changing the map projection using the CRS selector, the application may show a false incompatibility warning. This happens because of a logic mismatch between how background layers are selected and how CRS compatibility is validated.
The background group includes all layers marked as group: "background", including the terrain layer. However, the CRS compatibility check in the CRS selector validates only the currently active background entry. If the active/visible entry happens to be the terrain layer, and terrain is not considered CRS-compatible in that validation, the selector incorrectly reports that the projection is incompatible—even though the actual map background is valid for the selected CRS.
https://github.com/geosolutions-it/MapStore2/blob/master/web/client/plugins/CRSSelector/containers/CRSSelector.jsx#L117
How to reproduce
- Open a map with terrain background layer
- Switch projection
- An error appears saying that "The Projection you selected is not compatible with background. Switch to a compatible -or an empty- background, then select this projection."
Expected Result
The error shouldn't be displayed.
Current Result
The error prompt is preventing crs switch.
Browser info
(use this site: https://www.whatsmybrowser.org/ for non expert users)
| Browser Affected |
Version |
| Internet Explorer |
|
| Edge |
|
| Chrome |
|
| Firefox |
|
| Safari |
|
Other useful information
Description
When changing the map projection using the CRS selector, the application may show a false incompatibility warning. This happens because of a logic mismatch between how background layers are selected and how CRS compatibility is validated.
The background group includes all layers marked as group: "background", including the terrain layer. However, the CRS compatibility check in the CRS selector validates only the currently active background entry. If the active/visible entry happens to be the terrain layer, and terrain is not considered CRS-compatible in that validation, the selector incorrectly reports that the projection is incompatible—even though the actual map background is valid for the selected CRS.
https://github.com/geosolutions-it/MapStore2/blob/master/web/client/plugins/CRSSelector/containers/CRSSelector.jsx#L117
How to reproduce
Expected Result
The error shouldn't be displayed.
Current Result
The error prompt is preventing crs switch.
Browser info
(use this site: https://www.whatsmybrowser.org/ for non expert users)Other useful information