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

Problem with WFS in print #1740

Open
Lundqan opened this issue Apr 18, 2023 · 7 comments · May be fixed by #1741 or #1743
Open

Problem with WFS in print #1740

Lundqan opened this issue Apr 18, 2023 · 7 comments · May be fixed by #1741 or #1743
Labels

Comments

@Lundqan
Copy link

Lundqan commented Apr 18, 2023

In Origo map I have WMS and WFS layers added. All layers are set in EPSG:3010 which is defined in index.json.
All layers are fetched from Geoserver.

image

When printing from the Origo menu, the WFS layers are pushed aside, while the WMS stays put.

image

@jokd
Copy link
Contributor

jokd commented Apr 18, 2023

I was able to reproduce this. I think we have to refresh the wms source when entering the print view, otherwise old cached tiles may be used and mess up the print.

@jokd jokd added the bug label Apr 18, 2023
@Lundqan
Copy link
Author

Lundqan commented Apr 18, 2023

Is there any quick fix for WMS source refresh.
As in looping through visible layers and implementing

    if (layer.get('type') === 'WMS') {
      const layerSource = layer.get('source');
      layerSource.refresh();
}

@jokd jokd linked a pull request Apr 18, 2023 that will close this issue
@jokd
Copy link
Contributor

jokd commented Apr 18, 2023

Please test #1741
Perhaps a check if a layer is visible makes sense before doing unnecessary refreshing

@Lundqan Lundqan linked a pull request Apr 19, 2023 that will close this issue
@steff-o
Copy link
Contributor

steff-o commented Apr 19, 2023

It would be nice to get the full picture here before we rush into masquerading the error with a refresh. Although the solution may be just a refresh but I think it may not have to be performed as a general rule.

Is this something that has started to happen recently?

Does the map has the same coordinate system as the layers?

Are the WMSlayers cached on geoserver?

What are the values of the print settings:

  • supressResolutionsRecalculation
  • suppressNewDPIMethod
  • scales

Are the WMS-layers tiled or image?

Is the constrainResolution setting true?

I just think it is a bit strange that this hasn't been observed before unless something has changed or you have a different setup than most. I'm thinking that this could be related to the grid recalculation when the DPI changes, in which case it should probably be solved when the grid is recalculated instead.

@Lundqan
Copy link
Author

Lundqan commented Apr 19, 2023

It would be nice to get the full picture here before we rush into masquerading the error with a refresh. Although the solution may be just a refresh but I think it may not have to be performed as a general rule.

Is this something that has started to happen recently?

Does the map has the same coordinate system as the layers?

Are the WMSlayers cached on geoserver?

What are the values of the print settings:

  • supressResolutionsRecalculation
  • suppressNewDPIMethod
  • scales

Are the WMS-layers tiled or image?

Is the constrainResolution setting true?

I just think it is a bit strange that this hasn't been observed before unless something has changed or you have a different setup than most. I'm thinking that this could be related to the grid recalculation when the DPI changes, in which case it should probably be solved when the grid is recalculated instead.

The print settings are default

    {
      "name": "print"
    },

WMS tiles are default settings from Geoserver

image

@Grammostola
Copy link
Contributor

Grammostola commented Apr 19, 2023

I suppose the tiles are still in an EPSG:3010 gridset? If the map is set to 3010 I mean.

Am unable to repro the issue.
I have tried: a print definition like your example (empty), a wms layer that isn't the background layer cached in 3010, a wfs layer from the same geoserver, turn on both layers, print, exit print, no issue. The map is set to constrainResolution:true (because cached image layers)

@jokd
Copy link
Contributor

jokd commented Jun 28, 2023

@Lundqan Is this still an issue? When I'm testing with master it seems to work, perhaps something is changed in latest OL release.

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

Successfully merging a pull request may close this issue.

4 participants