Open corentin-teyssier opened 1 month ago
I'm trying to use custom javascript script to achieve my goal but since i'm not a specialist i'm having difficulties. My task is simple i want to filter ma layer "commune" and keep only the line where the column "departement" is in my list ['30','34'] at the load of the map on lizmap. I think this premade function is supposed to do something close to what i want : https://github.com/3liz/lizmap-javascript-scripts/blob/master/library/tools/attribute_table_column_filter/attribute_table_column_filter.js But since i'm not a javascript expert i've got some difficulties to understand the global structure and the object i'm supposed to manipulate. Can someone help me or advice me to create my filter function please ?
How can i use custom filter on inherited layer
I just started a new job and i get to work with Lizmap to create custom maps for each French region. To achieve this i would like to use the parent/child feature from Lizmap to create a parent project that contains every country scale layer. With a parent project i could create a project for each region with the specific regions layer combined to the inherited layers from the parent project. I tried this and it worked pretty well but ive got an issue with this architecture. I would like to have specific filter for each region on the inherited layers to only show the data for the given region but lizmap only use the parent filter.
I tried multiple solutions but none of them worked :
I tried to create a project variable for each region use it in the parent filter. But it seems that i can't interpret a variable in the query builder. (I tried "code_dep IN (@liste_dep) where liste_dep is a variable that contains every departments for a given region)
I also tried to write a python macro in Qgis. It worked pretty well in my local Qgis but doesn't execute at all in lizmap. I used the "def openProject()" macro to apply my filter at the start.
I can still do it without using the parent/child feature but it would help me a lot to maintain the whole project.
Thanks in advance for your time and excuse my english im not a native english speaker
Corentin
Versions, safeguards, check summary etc
Versions :
List of safeguards :
* Mode : safe * Allow parent folder : no * 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
Windows 11 for Qgis Desktop and Ubuntu 22.04 for QgisServer and Lizmap ont the server
Browsers
Chrome
Browsers version
Version 127.0.6533.73
Relevant log output
No response