Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
MV88 opened this issue Jan 7, 2025 · 0 comments
Open
1 task done

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

MV88 opened this issue Jan 7, 2025 · 0 comments
Assignees
Labels
Milestone

Comments

@MV88
Copy link
Contributor

MV88 commented Jan 7, 2025

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 :
1.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];
}

@MV88 MV88 added the bug label Jan 7, 2025
@MV88 MV88 self-assigned this Jan 7, 2025
@MV88 MV88 added this to the 2025.01.00 milestone Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant