lizmap-plugin icon indicating copy to clipboard operation
lizmap-plugin copied to clipboard

Inconsistant .cfg generation for project with grouped of layer

Open vlebert opened this issue 4 years ago • 5 comments

Description

Check project /qgis/arcep/pilote_v8.qgs On Tactis Lizmap instance hosted by 3Liz

This project lays on grouped layer ("Groupe comme une couche")

Everytime I regenerate the .cfg after editing in Lizmap-Plugin, I must edit the file in a text editor to correct it.

The first group of layer is incorect and contains the final layers (instead of the group only) which breaks the legend in Lizmap client.

Following groups of layer are OK

Generated .cfg :

...
    "layers": {
        "Pr\u00e9visions": {
            "id": "Pr\u00e9visions",
            "name": "Pr\u00e9visions",
            "type": "group",
            "title": "Pr\u00e9visions",
            "abstract": "",
            "link": "",
            "minScale": 1,
            "maxScale": 1000000000000,
            "toggled": "True",
            "popup": "False",
            "popupFrame": null,
            "popupSource": "auto",
            "popupTemplate": "",
            "popupMaxFeatures": 10,
            "popupDisplayChildren": "False",
            "noLegendImage": "False",
            "groupAsLayer": "False",
            "baseLayer": "False",
            "displayInLegend": "True",
            "singleTile": "True",
            "imageFormat": "image/png",
            "cached": "False",
            "serverFrame": null,
            "clientCacheExpiration": 300
        },
        "2020 (janvier) - 8Mbit/s": {
            "id": "2020 (janvier) - 8Mbit/s",
            "name": "2020 (janvier) - 8Mbit/s",
            "type": "layer",
            "title": "2020 (janvier) - 8Mbit/s",
            "abstract": "",
            "link": "",
            "minScale": 1,
            "maxScale": 1000000000000,
            "toggled": "True",
            "popup": "False",
            "popupFrame": null,
            "popupSource": "auto",
            "popupTemplate": "",
            "popupMaxFeatures": 10,
            "popupDisplayChildren": "False",
            "noLegendImage": "False",
            "groupAsLayer": "True",
            "baseLayer": "False",
            "displayInLegend": "True",
            "singleTile": "True",
            "imageFormat": "image/png",
            "cached": "False",
            "serverFrame": null,
            "clientCacheExpiration": 300
        },
        "In\u00e9ligibles \u00e0 la commune": {
            "id": "In\u00e9ligibles_\u00e0_la_commune_73c5087e_d18c_4c5a_bee3_5073ebbfc27d",
            "name": "In\u00e9ligibles \u00e0 la commune",
            "type": "layer",
            "geometryType": "polygon",
            "extent": [
                -63.1533382869624,
                -21.389730741571,
                55.8366504886634,
                51.0889911002372
            ],
            "crs": "EPSG:4326",
            "title": "In\u00e9ligibles \u00e0 la commune",
            "abstract": "",
            "link": "",
            "minScale": 0,
            "maxScale": 1500000,
            "toggled": "False",
            "popup": "False",
            "popupFrame": null,
            "popupSource": "auto",
            "popupTemplate": "",
            "popupMaxFeatures": 10,
            "popupDisplayChildren": "False",
            "noLegendImage": "False",
            "groupAsLayer": "False",
            "baseLayer": "False",
            "displayInLegend": "True",
            "singleTile": "True",
            "imageFormat": "image/png",
            "cached": "False",
            "serverFrame": null,
            "clientCacheExpiration": 300
        },
        "In\u00e9ligibles au d\u00e9partement": {
            "id": "Nombre_d_in\u00e9ligibles_au_d\u00e9partement_9dc540dd_ab61_4b7e_ad4b_c59a34f864a4",
            "name": "In\u00e9ligibles au d\u00e9partement",
            "type": "layer",
            "geometryType": "polygon",
            "extent": [
                -61.8097613541703,
                -21.389730741571,
                55.8366504886634,
                51.08984197105
            ],
            "crs": "EPSG:4326",
            "title": "In\u00e9ligibles au d\u00e9partement",
            "abstract": "",
            "link": "",
            "minScale": 1500000,
            "maxScale": 150000000,
            "toggled": "False",
            "popup": "False",
            "popupFrame": null,
            "popupSource": "auto",
            "popupTemplate": "",
            "popupMaxFeatures": 10,
            "popupDisplayChildren": "False",
            "noLegendImage": "False",
            "groupAsLayer": "False",
            "baseLayer": "False",
            "displayInLegend": "True",
            "singleTile": "True",
            "imageFormat": "image/png",
            "cached": "False",
            "serverFrame": null,
            "clientCacheExpiration": 300
        },
        "4GF meilleure techno": {
            "id": "4GF_meilleure_techno_5f54013a_6dd0_44d0_a29d_1f7b5db359a3",
            "name": "4GF meilleure techno",
            "type": "layer",
            "geometryType": "polygon",
            "extent": [
                -63.1533382869624,
                -21.389730741571,
                55.8366504886634,
                51.0889911002372
            ],
            "crs": "EPSG:4326",
            "title": "4GF meilleure techno",
            "abstract": "",
            "link": "",
            "minScale": 0,
            "maxScale": 1500000,
            "toggled": "False",
            "popup": "False",
            "popupFrame": null,
            "popupSource": "auto",
            "popupTemplate": "",
            "popupMaxFeatures": 10,
            "popupDisplayChildren": "False",
            "noLegendImage": "False",
            "groupAsLayer": "False",
            "baseLayer": "False",
            "displayInLegend": "True",
            "singleTile": "True",
            "imageFormat": "image/png",
            "cached": "False",
            "serverFrame": null,
            "clientCacheExpiration": 300
        },
        "2021 (janvier) - 8Mbit/s": {
            "id": "2021 (janvier) - 8Mbit/s",
            "name": "2021 (janvier) - 8Mbit/s",
            "type": "layer",
            "title": "2021 (janvier) - 8Mbit/s",
            "abstract": "",
            "link": "",
            "minScale": 1,
            "maxScale": 1000000000000,
            "toggled": "False",
            "popup": "False",
            "popupFrame": null,
            "popupSource": "auto",
            "popupTemplate": "",
            "popupMaxFeatures": 10,
            "popupDisplayChildren": "False",
            "noLegendImage": "False",
            "groupAsLayer": "True",
            "baseLayer": "False",
            "displayInLegend": "True",
            "singleTile": "True",
            "imageFormat": "image/png",
            "cached": "False",
            "serverFrame": null,
            "clientCacheExpiration": 300
        },
...

Expected result .cfg:

...
"    layers": {
        "Pr\u00e9visions": {
            "id": "Pr\u00e9visions",
            "name": "Pr\u00e9visions",
            "type": "group",
            "title": "Pr\u00e9visions",
            "abstract": "",
            "link": "",
            "minScale": 1,
            "maxScale": 1000000000000,
            "toggled": "True",
            "popup": "False",
            "popupFrame": null,
            "popupSource": "auto",
            "popupTemplate": "",
            "popupMaxFeatures": 10,
            "popupDisplayChildren": "False",
            "noLegendImage": "False",
            "groupAsLayer": "False",
            "baseLayer": "False",
            "displayInLegend": "True",
            "singleTile": "True",
            "imageFormat": "image/png",
            "cached": "False",
            "serverFrame": null,
            "clientCacheExpiration": 300
        },
        "2020 (janvier) - 8Mbit/s": {
            "id": "2020 (janvier) - 8Mbit/s",
            "name": "2020 (janvier) - 8Mbit/s",
            "type": "layer",
            "title": "2020 (janvier) - 8Mbit/s",
            "abstract": "",
            "link": "",
            "minScale": 1,
            "maxScale": 1000000000000,
            "toggled": "True",
            "popup": "False",
            "popupFrame": null,
            "popupSource": "auto",
            "popupTemplate": "",
            "popupMaxFeatures": 10,
            "popupDisplayChildren": "False",
            "noLegendImage": "False",
            "groupAsLayer": "True",
            "baseLayer": "False",
            "displayInLegend": "True",
            "singleTile": "True",
            "imageFormat": "image/png",
            "cached": "False",
            "serverFrame": null,
            "clientCacheExpiration": 300
        },
        "2021 (janvier) - 8Mbit/s": {
            "id": "2021 (janvier) - 8Mbit/s",
            "name": "2021 (janvier) - 8Mbit/s",
            "type": "layer",
            "title": "2021 (janvier) - 8Mbit/s",
            "abstract": "",
            "link": "",
            "minScale": 1,
            "maxScale": 1000000000000,
            "toggled": "False",
            "popup": "False",
            "popupFrame": null,
            "popupSource": "auto",
            "popupTemplate": "",
            "popupMaxFeatures": 10,
            "popupDisplayChildren": "False",
            "noLegendImage": "False",
            "groupAsLayer": "True",
            "baseLayer": "False",
            "displayInLegend": "True",
            "singleTile": "True",
            "imageFormat": "image/png",
            "cached": "False",
            "serverFrame": null,
            "clientCacheExpiration": 300
        },
...

Context

  • QGIS version: 3.10.12-A Coruña
  • Lizmap version: Plugin 3.2.18
  • OS: Windows

vlebert avatar Dec 16 '20 09:12 vlebert

See attached the generated .cgf and the expected one (manual edition of the .cfg)

generated.txt

expected.txt

vlebert avatar Dec 16 '20 09:12 vlebert

I just tested with version 3.3.2 of the plugin: same problem

vlebert avatar Dec 16 '20 09:12 vlebert

Can you add a screenshot of the legend regarding this group ? and layers (4GF meilleure techno, In\u00e9ligibles \u00e0 la commune, In\u00e9ligibles au d\u00e9partement )

I would needto check with my colleages @mdouchin @nboisteault I think.

Gustry avatar Dec 16 '20 14:12 Gustry

Here is it

image

vlebert avatar Dec 16 '20 16:12 vlebert

The plugin will now warn you if there is duplicated names. Not the best solution, but better to have an error now.

Gustry avatar Jul 27 '23 15:07 Gustry