You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If you have a WMS layer that require credentials it will display correctly in the map. If you later want to print that map you will get a 401 error and the WMS layer is not included in the print.
Solution
In my investigation of the error I found that the problem seems to lie in the function exchangeLayer in the PrintModel.js file.
For some reason the `crossOrigin` property is not exposed on `ImageWMS`... It feels wrong but i cannot find another way than checking the value of the private `crossOrigin_` property.
Tested the generic get:er (`source.get("crossOrigin")`) and it returns `undefined` as well.
Please test it out now. For some reason the crossOrigin property is not publicly available... Using the private property feels bad but it should do the trick.
Yes, it feels like a bug in OL. It seems to be working with TileWMS source but not with ImageWMS.
I vote for the sollution @maan002 presents, just add a nice comment :)
Describe the bug
If you have a WMS layer that require credentials it will display correctly in the map. If you later want to print that map you will get a 401 error and the WMS layer is not included in the print.
Solution
In my investigation of the error I found that the problem seems to lie in the function
exchangeLayer
in the PrintModel.js file.The code looks like this:
However, if you check the values of the
source
object you will find thatsource.crossOrigin
is undefined.The text was updated successfully, but these errors were encountered: