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

The pairs of "layer/style" are not sent correctly anymore #940

Closed
jacobwod opened this issue Dec 1, 2021 · 4 comments
Closed

The pairs of "layer/style" are not sent correctly anymore #940

jacobwod opened this issue Dec 1, 2021 · 4 comments
Labels
Projects
Milestone

Comments

@jacobwod
Copy link
Member

jacobwod commented Dec 1, 2021

Prior to #884 we created a correct URL with pairs of layer and corresponding styles like this:

.filter((k) => subLayersToShow.indexOf(k[0]) !== -1)

In #884 that was changed to remove the empty styles:

(k) => subLayersToShow.indexOf(k[0]) !== -1 && k[1].style !== ""

However, this breaks the custom style functionality completetly, as we don't send correct parings of LAYERS and STYLES.

Prior the change the following parameters were send with the GetMap request (I only show the relevant parts):

LAYERS=fastighetsytor%2Ckvartersnamn%2Ckvartergrans%2Cfastighetsbeteckningar
STYLES=%2Cbmf%3Akvartersnamn%2C%2C

After the change, we get this however:

LAYERS=fastighetsytor%2Ckvartersnamn%2Ckvartergrans%2Cfastighetsbeteckningar
STYLES=bmf%3Akvartersnamn

**It might look similar, but it's not. The commas (encoded as %2C) got removed and now the WMS service gets a request for 4 layers but with only 1 style requested, which breaks the functionality completely. **

@jacobwod jacobwod added the bug label Dec 1, 2021
@jacobwod jacobwod added this to the 3.8 milestone Dec 1, 2021
@jacobwod jacobwod added this to Approved ideas in Hajk via automation Dec 1, 2021
@jacobwod jacobwod changed the title The pairs of "layer/style" are not send correctly anymore The pairs of "layer/style" are not sent correctly anymore Dec 1, 2021
Hajk automation moved this from Approved ideas to Done Dec 1, 2021
@hitomin21
Copy link
Contributor

This might be a difference between QGIS server and Geoserver, I get the opposite problem where if "empty" styles are sent we get incorrect responses, as I described in
#841

I had problems when STYLES=, was sent to the WMS server. Do you get a correct response even when all styles are empty?
@jacobwod

@jacobwod
Copy link
Member Author

jacobwod commented Dec 1, 2021

This is from GeoServer. Try for yourself. This works but if you remove just one of the commas in STYLE parameter it won't.

@jacobwod
Copy link
Member Author

jacobwod commented Dec 1, 2021

Do you get a correct response even when all styles are empty? @jacobwod

I do but it is not relevant as a possible (and common) use case is to have a bunch of layers, use default styles (e.g. empty string) on most of them, but override one layer's style with a specific, named style.

@hitomin21
Copy link
Contributor

Thanks, I will have to re-visit what caused the issues for us in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Hajk
  
Done
Development

No branches or pull requests

2 participants