Localización por capas
Principle
The idea of this tool is to present to the Lizmap Web Client user a drop down list that gives the ability to zoom on one or more spatial objects of the layer.
Casos de uso
Consider a spatial vector layer districts contained in the QGIS project. We choose to add these districts in the tool Locate by layer, to allow Lizmap Web Client users to quickly position on one of the districts.
Once this layer added in the tool Locate by layer, a drop down list of the districts appears on the Lizmap Web interface.
When the Web map user selects one name in this list, the map will automatically refocuses on the selected district and the district’s geometry is displayed (optional).
Prerrequisitos
The layer must be published as WFS (see WFS/OAPI) and the primary key must be published as well in the Layer properties.
Advertencia
This tool is not designed for layers having a lot of features or a lot of complex geometries. The web browser will indeed have to download all features with vector geometries so it will make the loading the application slower. To reduce the loading time, you can reduce the decimals in the WFS settings for instance if your layer is in meters. For better performance if your layer is stored in PostGIS, use PostgreSQL search.
Configuring the tool
Para añadir una capa a esta herramienta:
Click the button.
choose the layer with the first dropdown from the list of the project vector layers
then the column that contains the label you want to display in the dropdown list
if you want to add pre-filter your data if a optional group by, use the Optional group by field.
if you want the geometry of the related objects is also displayed on the map when the user selects an item from the list, then check the option Display the geometry
If you set a value above 0, autocompletion will be used after this amount of characters while the user types. The classical combobox will be replaced by a editable text input.
If Lizmap must trigger the filter on the layer. Only the selected feature will be visible on the map.
To edit a layer in the table, select it and click the button or double click on the row.
To remove a layer from the table, select it and click the button.
To move a layer up or down, select it and click or buttons. The order will change in Lizmap too.
Hierarchical Lists
Si tomamos el ejemplo de los distritos, puede ser interesante facilitar al ususario un menú desplegable de subdistritos. Lo que se quiere conseguir es que cuando el usuario seleccione un distrito, el menú desplegable de subdistritos, muestre automáticamente solamente los subdistritos del distrito seleccionado.
Para conseguir esto, existen dos métodos:
o bien tiene 2 separate vector layers: una para distritos y subdistritos. Por lo tanto, debe usar una field join entre las dos capas para habilitar el filtrado automático de listas en Lizmap
o bien se tiene only 1 layer for sub-districts, y entonces se puede especificar mediante el plugin un group field. Dos menúes desplegable se crearán en lugar de uno en la aplicación Web.
Nota
Don’t forget to check if your configuration of QGIS server is the right one (in Lizmap : My account -> Lizmap configuration -> check if the qgis server version is the right one, if not, you can use the button “modify” below). If the configuration is not right the location will be wrong!