Prerequisites¶
Qgis side¶
- Project must be saved
- Project projection must be set
- Projections must be set for each layer
- Data (vector and raster) must be stored in the same folder of the project file, or in a subfolder. You can use the python extension QConsolidate to do it automatically.
- Project paths must be set to relative (see project properties dialog)
- WMS options must be set in the project properties
- The FTP synchronisation only works on linux and windows operating systems.
- On Linux plateforms, the software lftp must have been installed. By example enter the command line : "sudo aptitude install lftp"
- On Windows plaforms, WinSCP Portable is used and must be downloaded from http://winscp.net/eng/download.php . Please choose the Portable executables version, then unzip it in some folder. You will have to choose this folder in the FTP tab
- On Mac plateforms, there is at the moment no sync tool. Please use a FTP client to synchronize the modified files.
Server side¶
- Qgis Server must be installed.
- You need FTP write access to a directory aka remotedir in this help.
- Lizmap Web Client must be installed and correctly configured.
Usage¶
Please read the following desription of each interface tab first. The usage scenario is written further down.
Tab Layers¶
This tab shows the exact tree of groups and layers from your project. With this tree, you can several options for each group or layer just by selecting a group/layer in the tree. Then you can edit the input fields right to the tree :
- Title : the title of the group/layer. You can use this field to rename the group or layer. For example, you could have a layer called "main_rivers", and title it "Main rivers". This title will be displayed by Lizmap web application, not the layer/group name.
- Abstract : a short description of the group/layer. This abstract will be shown on hover of the title in Lizmap web app.
- Link : an html link such as "http://qgis.org". If a link is given for a group or a layer, an icon "(i)" will be shown next to the group/layer title in Lizmap. Clicking on the icon will open a new browser window pointing to this link.
- Toggled : If checked, the group/layer will be also checked and visible in Lizmap. If not, the user will have to check it manually.
- Popup : If checked, a popup will be shown by Lizmap Web Client when clicking on the map for the selected feature of this layer.
- Configure popup :
This button, right next to the Popup checkbox opens a new small windows where you can write down a template for the layer pop-up. You can write plain text or HTML code.
- Group as layer : This checkbox is only useful for groups. By checking it, you can transform a qgis group (with child groups and/or layers) into a single layer in Lizmap web application. The children won't appear in Lizmap layer lists. The legend for this group will display every child legend.
- Base layer : If this checkbox is checked, the group/layer will appear in the list of base layers. If not, the group/layer will appear in the list of overview layers.
- Singletile : If checked, Lizmap web application will display a single image corresponding to the map viewport. If not, Lizmap will ask for several small images (tiles) to fill the viewport. You can choose singletile to avoid truncated labels. Do not use it if you want to activate the cache for this layer !
- Image format : you can specify the image format you want QGIS Server to use for the GetMap request. Select one of the format among:
- image/png: classical png format, which produces high level quality images, and handle transparency
- image/png; mode=8bit: 8bit png format, which produces images with smaller size, but does not handle transparency.
- jpeg: produces small images, but is not lossless, won't keep transparency, and could produced "blured" images, especially with labels
- Cached : You can check it for a group/layer to tell Lizmap Web Client to automatically cache the tiles generated by Qgis Server for this group/layer. The web client will use the cache if it exits, else it will request the images to QGIS Server and put it in the cache. This options will help you to provide very responsive web maps.
- Expiration (s) : if you have set the cached on, you can set the expiration time for the layer cache. You must give a duration in seconds. Tiles older than this duration will be replaced on the fly by Lizmap caching system. You can set this value to 0, so that you cache never expires (good for layers with permanent data through the time).
- Metatile The user can now choose for each cached layer if he wants to use metatiling or not when generating the cached images. Activating metatile will request larger tiles from QGIS Server, and split them up. This will avoid to have map tiles with truncated and redundant labels. You can define for example a metatile option to "5,5" which will ask for images 5 times larger. Be aware that this option, by asking bigger images from Qgis Server, will slow down the first generation of the tiles. Once generated and put in the ache though, performance won't change.
Tab Map¶
In this tab, you can edit some basic options for the map displayed by Lizmap web application :
- Min. Scale : The minimum scale of Lizmap map. E.g "10000"
- Max. Scale : The maximum scale of Lizmap map. E.g "1000000"
- Zoom leves number : The number of zoom levels of Lizmap map between max scale and min scale. E.g. 10.
- Scales : You can overwrite the 3 previous options (min and max scale, zoom level number) by entering a list of scales you want to display in Lizmap map. The scales must be separated by commas ",". E.g. "1000000, 500000, 200000".
- Public baselayers : If you have no layers well suited to play the role of base layers, you can add external baselayers. At the moment, only OpenStreetmap and Google layers are supported. Just check the corresponding boxes to add these layers. (if your choose Google Layers, you can optionaly add your Google Key).
This action will have the following consequences :
- the previous scale related options will be overwritten by the web application to fit the default scales used by OSM or Mapquest servers. Make sure the symbology chosen for you layers takes it into account.
- the lizmap web client will ask Qgis Server to reproject all you data into Google Mercator. To allow this, you will need to add "EPSG:900913" in the "Coordinate System Restrictions" area of the "WMS Server" tab in the "Project Properties" dialog.
Tab FTP¶
In this tab, you can write and edit FTP options to tell the plugin where and how to store your local project data on the server :
- host : FTP host, corresponding to the server where Qgis Server is installed (ip address or domain)
- port = Ftp port (21 if not given)
- remotedir = Path to the directory where all your qgis project data (project file, rasters and vectors) must be sent.
- For Windows users, you must give a full path, for exemple : "/home/username/myremotedir/" (please ask the server admin for the complete path to you FTP root folder).
- For linux users, just use a relative path, such as "/myremotedir/"
- winscp full path = For Windows users only ! Path to the directory containing WinScp executables. WinScp "Portable version" must be downloaded from http://winscp.net/eng/download.php . Please download it, then unzip it in some folder. E.g. "C:\winscp\" . You can then use the button "..." to choose the directory containing "WinScp.com".
Tab Log¶
This tab shows the log written when clicking on "Save" or "Save and Sync" buttons:
- The small input shows file operations processed during a FTP sync.
- The big text area shows the actions made by the plugin : input data checking, ftp actions report, warnings and errors.
- When performing a FTP synchronisation, an orange message "running" is written next to the "Clear log" button, and a small progress bar moves from 0 to 1 each time an FTP operation has been made.
- You can cancel a FTP Synchronization by clicking the "Cancel" button in the Log tab.
- You can clear the log by clicking on the "Clear log" button.
Usage¶
- Read this help with care.
- Check that you have properly set your project options.
- Edit the options in each plugin tab.
- Click the "Save" button will save the configuration in a file stored next to your qgis project file. Then you will have to manually send the modified files (project, config file, raster and vector data, etc.) from your computer to the remote FTP directory.
- Click the "Save and synchronize" button will first save the configuration. It will then synchronize your local directory (where the project file and all data are stored on your computer) to the "remotedir" server directory :
* every local updated or non existing file will be sent,
* every remote file which does not exist locally will be removed.
Note that only the modified files will be sent to prevent unwanted network usage.
WARNING : all the content of the server directory not related to your local project will be lost !
Alway have a fresh backup of your local project and data files !
Lizmap Hints¶
Lizmap Qgis plugin aims to be used to configure a web application dynamically generated by Lizmap with the help of Qgis Server. With this plugin, you can configure one web map per Qgis project. Details on each tab is given above.
Things to consider :¶
- Layers and groups naming conventions: all the group and layers defined in Qgis Layer Tree must follow the following rules :
- no accentuated characters
- no special chars
- no space
You will be able to change how the layer is nammed in Lizmap Web Application by editing the title field in the "Layers" tab of Lizmap plugin.
- Configuration backup :
The layers, map and ftp options are saved each time "Save" or "Save and synchronize" are launched :
- layers and map options are stored in a configuration file in the same folder as Qgis project file. E.g. projectname.qgs.cfg if your project file is called projectname.qgs. When you open a project in Qgis and then launch lizmap plugin, the input fields will be set accordingly if possible (e.g. if you have not change the name of the layers)
- FTP options are stored in lizmap.cfg file in lizmap plugin folder. It means you must check the FTP options each time you run the plugin in case you work on different project with different FTP server options.
Project options¶
Some of the project options are not displayed in lizmap plugin but are indeed used by Lizmap web application : WMS options, project name and description, projection, extent, etc.
- Group and layers visibility
- min and maxscales : A layer will be active and visible on map in Lizmap web application only if the current zoom level matches the min and max scales if this visibility is set in the layer properties dialog.
- a group wich has the "Group as layer" option checked will be visible as soon as one of its child layers is visible.
Overview¶
If there is a group name "Overview" (with the capital O at the beginning) in your qgis project, there will be a small Overview map displayed in Lizmap web application. These layers won't be displayed in the main map. Please check the layers of this group are visible at all scales.