qgis / qwc2-demo-app

QWC2 demo application
Other
240 stars 149 forks source link

Rendering issue due to different DPI between QGISServer and QWC2 #544

Closed Ducarouge closed 3 months ago

Ducarouge commented 3 months ago

Hi,

After an update of a QWC2 instance, we have some rendering issues in a QGIS project containing symbology based on scales rules.

This differences seems to come from the following commit: https://github.com/qgis/qwc2/commit/8afc3d81e86b1b27a26a07d2adc8042858a1bfb7

Indeed :

So this is what we get from the same call to QGIS Server with and without the DPI parameter :

Is this a bug or there is a way to configure QWC2 (or the QGIS Project) to get the same rendering between QWC2 and QGIS ?

manisandro commented 3 months ago

Does OpenLayers actually send a DPI parameter in the GetMap request?

Ducarouge commented 3 months ago

No, actually, Openlayers send a POST request for the GetMap without this DPI parameter and, i guess, this why we don't have the same rendering.

manisandro commented 3 months ago

Can you try re-adding the DPI via removed in https://github.com/qgis/qwc2/commit/8afc3d81e86b1b27a26a07d2adc8042858a1bfb7 like so

DPI:  options.serverType === 'qgis' ? (options.dpi || ConfigUtils.getConfigProp("wmsDpi") || 96) : undefined
Ducarouge commented 3 months ago

When i re-add the DPI with the line above, it works as expected.

For the fix, do i have to do a PR or you do ?

Thank you.

manisandro commented 3 months ago

Done in https://github.com/qgis/qwc2/commit/dbe973da4f0dc7337f1ed8547959d1902d9a37c5