Closed NvBgm closed 9 months ago
I guess you mean this link ? https://docs.lizmap.com/current/fr/publish/customization/javascript.html
Indeed, it needs an update.
@Gustry I'm not even sure we should keep this example. Should we communicate on the Activate first map theme on startup
instead?
Here is the new way
lizMap.events.on({
uicreated: function(e) {
for (const treeItem of lizMap.mainLizmap.state.layerTree.findTreeLayersAndGroups()) {
if (treeItem.type != 'group') {
continue;
}
if (treeItem.name != 'test') {
continue;
}
treeItem.expanded = true;
}
}
});
Can i collapse several groups using commas ??
@NvBgm Does using a QGIS theme not enough for your needs ?
@rldhont how can i unchek a group?
like above i'm trying with treeItem.checked = false;
but it doesn't work
What is the bug?
Collapse a group in the legend.
When a add this js script to "\media\js\testmap\" or in the default "\media\js\default" map both does not work anymore.
Themes/JavaScript enable on the repositories.
Steps to reproduce the issue
Add js script from example in lizmap v3.7.2 doc.
Versions, safeguards, check summary etc
Versions :
List of safeguards :
* Mode : normal * Allow parent folder : yes * Number of parent : 2 folder(s) * Prevent other drive : yes * Prevent PG service : yes * Prevent PG Auth DB : yes * Force PG user&pass : yes * Prevent ECW : yes
Check Lizmap plugin
Operating system
Window 11
Browsers
Chrome
Browsers version
Chrome Versie 120.0.6099.227 (Officiële build) (64-bits)
Relevant log output
No response