Description
Changing the map CRS can crash when the selected CRS uses a datum grid and a layer has minResolution or maxResolution.
The problem is caused by convertResolution(web/client/utils/MapUtils.js), which transforms a random point to the target CRS and then passes it to getPointResolution together with the source projection. The point is therefore interpreted in the wrong CRS, and the unnecessary transformation can fail when it falls outside the datum grid coverage.
Some errors observerd:
mapstore2.js?c97a1ffaf62e2a5c:2 Uncaught TypeError: coordinates must be finite numbers
at Ce (
mapstore2.js?c97a1ffaf62e2a5c:2 Uncaught TypeError: cannot destructure property 'zoom'
How to reproduce
- Configure a CRS that uses a datum grid.
- Add a layer with
minResolution or maxResolution.
- Change the map to the configured CRS.
Expected Result
The map CRS changes successfully and the layer resolution limits are updated.
Current Result
The CRS change fails with a transformation error.
Other useful information
Description
Changing the map CRS can crash when the selected CRS uses a datum grid and a layer has
minResolutionormaxResolution.The problem is caused by
convertResolution(web/client/utils/MapUtils.js), which transforms a random point to the target CRS and then passes it togetPointResolutiontogether with the source projection. The point is therefore interpreted in the wrong CRS, and the unnecessary transformation can fail when it falls outside the datum grid coverage.Some errors observerd:
How to reproduce
minResolutionormaxResolution.Expected Result
The map CRS changes successfully and the layer resolution limits are updated.
Current Result
The CRS change fails with a transformation error.
Other useful information