-
Notifications
You must be signed in to change notification settings - Fork 45
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
Print: Part of layer doesn't get printed as expected #1301
Comments
This can sometimes happen when you set visibility i GeoServer. In some occations we've had to change visibility levels in GeoServer for crucial printing scenarios. |
That's sounds reasonable but I thought I compensated for this in my checks before writing this issue (I tried with 72, 150 and 300 DPI - all with the same result). But I'll check once more, more carefully. Thanks. |
Maybe I'm wrong. It was just my initial thought |
I was just about to comment that i could not reproduce, haha. (Chrome). |
I would suggest to look at the requests created when printing. Do they include the correct dpi etc? |
disable cache and test again |
Just examined the requests. I think I see what the problem is: we ignore the zIndex from OpenLayers. I want to print a combined image, consisting of three layers. Here's what I see: So far so good. When I print, we see 3 requests, as expected: If you want, you can try out the requests in your own browser (just expand the section below): But how does the composed PDF look like? Like this. To me, it looks as if we ignore the zIndex and just use the order in which the requests return from server. Since at least one of those layers is fully opaque, we don't see anything below (which happens to be our labels). What's your take on this? 🤔 |
Im currently in a meeting, will look later today. Might have missed the z-index tbh! That theory fits well with the fact that the result differ from time to time. |
Good find! I think that we should respect OL's current zIndex value. It gets especially important now when we have the Active layers tab in LayerSwitcher. I'll see if I manage to get a look into it this week, thanks! |
Yes of course! It's a miss by me! |
Doesn't matter! 😄 |
const layerOpacity = layer.getOpacity() ?? 1;
const layerZIndex = layer.getZIndex(); "<------"
// Then we can create the new image-layer with the new image-source.
const imageLayer = new ImageLayer({
opacity: layerOpacity,
source: imageSource,
zIndex: layerZIndex, "<------"
}); Should do the trick!? :) |
Yes, pretty much - see ba33524 😉 |
Describe the bug
It seems that some layers - I'm still unsure what distinguishes them - don't print as expected.
I'd like to stress that I'm not sure whether it's a bug with the print plugin, or some failing configuration on the WMS-side.
To Reproduce
Steps to reproduce the behavior:
Screenshot and PDF
See attached PDF and compare it to the screenshot below.
The text was updated successfully, but these errors were encountered: