Skip to content

Visibility limits on layer are not consistent when switching CRS #10739

Description

@MV88

Description

When setting visibility limits on a layer, for example on the current visualization scale, those limits are respected and the layer, for example if we set it invisible, the layer will disappear from the visualization of the map and this is correct.

When looking at the same map, switching the projection to EPSG:4326

We can see the visibility limits scale will change and the visibility limits seem not to be respected for the current visualization of the map in a different projection.

See video attached

What we ideally look for is to keep the same visualization limits and see no change in the layers visualization behaviour.

Ticket attachments :

recording_1.mp4

How to reproduce

  • go to display settings
  • set up visibility limits on a layer and stay there
  • change crs in the map

Expected Result

visibility limits gets recalculated on map crs change
Current Result

this are not recalculated correctly and layer may disappear

  • Not browser related
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

The issue happens when some visibility limits are defined and then a crs for the map is changed
at this point the value of maxResolution and/or minResolution (it depends which one you have defined) are not updated accordingly in side layers properties ( state.layers.flat.layers[...] )
on a technical point of view when CHANGE_MAP_CRS is changed these two values are not updated accordingly.

we have to make sure that this is done, and maybe transform the CHANGE_MAP_CRS into a thunk action so that it can fetch info from state if needed to recalculate these values probably using

export function getCurrentResolution(currentZoom, minZoom, maxZoom, dpi) {
if (getHook("RESOLUTION_HOOK")) {
return getHook("RESOLUTION_HOOK")(currentZoom, minZoom, maxZoom, dpi);
}
/* if no hook is registered (leaflet) it is used the GoogleMercatorResolutions in
in order to get the list of resolutions */
return getGoogleMercatorResolutions(minZoom, maxZoom, dpi)[currentZoom];
}

Activity

  1. self-assigned this
    on Jan 7, 2025
  2. added this to the 2025.01.00 milestone on Jan 7, 2025
  3. added a commit that references this issue on Jan 13, 2025
    ce7f7ec
  4. added
    BackportNeeded
    on Mar 7, 2025
  5. modified the milestones: 2025.01.00, 2025.01.01 on Apr 4, 2025
  6. modified the milestones: 2025.01.01, 2025.01.00 on May 19, 2025
  7. self-assigned this
    on May 20, 2025
  8. added a commit that references this issue on May 20, 2025
    a127923
  9. added a commit that references this issue on May 21, 2025
    ead4cf0
  10. added a commit that references this issue on May 21, 2025
    43507ab
  11. removed
    BackportNeeded
    on May 21, 2025
  12. added 2 commits that reference this issue on Aug 26, 2025
    984ef98
    0c1cf40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions