3liz / lizmap-plugin

Lizmap plugin for QGIS, allowing to publish QGIS maps to Lizmap Web Client
https://www.lizmap.com/
GNU General Public License v2.0
62 stars 31 forks source link

Add new blocker rule when the layer or group has a trailing space #542

Closed r9zzai closed 9 months ago

r9zzai commented 9 months ago

Description

on a recent commit (4.0.2) following new feature is added Add new blocker rule when the layer or group has a trailing space

what is the use for that check? WMS/WFS requests are fine for me. I used trailing spaces in layer names many times to show a variant of a layer in another context (another group). So can that check be reverted for layers?

Context

Versions :

Gustry commented 9 months ago

The issue is linked to OpenLayers. When Lizmap Web Client gives a layer name like bakeries, OpenLayers will trim it itself, for it gives back bakeries.

Do you mean you have for instance bakeries in one context and bakeries for the same layer, but in another context ?

r9zzai commented 9 months ago

Yes, but i use only trailing whitespaces. So if that would not affect OL than would it be be OK to change the trim function from str.strip to str.lstrip?

Gustry commented 9 months ago

Sorry, my example was just with the left trim, but OL does both, left and right. bakeries will be become bakeries when using OpenLayers.

Sorry, but I fail to understand why you are using trailing whitespace in different context. Many tools might trim and it looks like a bad solution. Why do you add a trailing whitespace on purpose ? Was-it because QGIS desktop was complaining about duplicated layer name ? The fix about that is set a "shortname" in your QGIS server tab of the layer.

r9zzai commented 9 months ago

yes, it because QGIS desktop was complaining about duplicated layer name. Ah okay i updated lizmap plugin and new the error (duplicated layer name) is resolved. Thank you for the hint.