Skip to content

CRS change crashes with grid-based projections when layer resolution limits are configured #12627

Description

@rowheat02

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.

  • Not browser related

Other useful information

Metadata

Metadata

Assignees

Labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions