WARNING the master branch is compatible only with QGIS 3.x from August 23rd 2018. The branch qgis2 targets QGIS 2.x compatibiliy.
Publication plugin for Lizmap Web Application, by 3LIZ.
begin : 2011-11-01
copyright : (C) 2011 by 3liz
authors : René-Luc D'Hont and Michaël Douchin
email : [email protected]
website : http://www.3liz.com
Lizmap Qgis plugin aims to be used to configure a web application dynamically generated by Lizmap (php/html/css/js) with the help of Qgis Server ( QGIS Server Tutorial ) With this plugin, you can configure one web map per Qgis project. The Lizmap web application must be installed on the server.
The Original Code is 3liz code.
The Initial Developer of the Original Code are René-Luc D'Hont [email protected] and Michael Douchin [email protected]. Portions created by the Initial Developer are Copyright (C) 2011 the Initial Developer. All Rights Reserved.
- Salvatore Larosa @slarosa
- Paolo Cavallini @pcav
- Arnaud Deleurme
- @ewsterrenburg
- Sławomir Bienias @SaekBinko
- Petr Tsymbarovich @mentaljam
- Víctor Herreros @vherreros
- João Gaspar
- Felix Kuehne
- Kari Salovaara
- Xan Vieiro
- Etienne Trimaille @Gustry
- José Macau
Please propose a PR to add yourself if you are missing
from github repository:
- Clone the repo:
git clone [email protected]:3liz/lizmap-plugin.git
cp lizmap-plugin ~/.qgis2/python/plugins
cd ~/.qgis2/python/plugins
mv lizmap-plugin lizmap
or from QGIS application:
- Plugins menu -> Manage and Install Plugins...
- Select LizMap plugin from Not installed list
- Install plugin
You can use the Makefile to update and compile the strings for translation.
# Update strings
make transup
# Compile
make transcompile
Version: MPL 2.0/GPL 2.0/LGPL 2.1
The contents of this file are subject to the Mozilla Public License Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
Alternatively, the contents of this file may be used under the terms of either of the GNU General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the LGPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of either the GPL or the LGPL, and not to allow others to use your version of this file under the terms of the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL or the LGPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of any one of the MPL, the GPL or the LGPL.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
You can use the lizmap_api
class of lizmap.py
to get the Lizmap JSON configuration for a specific project.
For example:
import sys,os
qgisPrefixPath = "/usr/local/"
sys.path.append(os.path.join(qgisPrefixPath, "share/qgis/python/"))
sys.path.append(os.path.join(qgisPrefixPath, "share/qgis/python/plugins/"))
os.environ["QGIS_DEBUG"] = '-1'
os.environ['QGIS_PREFIX_PATH'] = qgisPrefixPath
from qgis.core import QgsApplication
QgsApplication.setPrefixPath(qgisPrefixPath, True)
app = QgsApplication([], False)
app.initQgis()
# Run the lizmap config exporter
from lizmap import lizmap
project_path = '/home/mdouchin/test_a_sup.qgs'
lv = lizmap.LizmapConfig(project_path)
if lv:
# get the JSON content with default values
json_content = lv.to_json()
# OR:
# get the JSON content with user defined values
my_global_options = {
'mapScales': [1000, 2500, 5000, 10000, 25000, 50000, 100000, 250000], # set the map scales
'osmMapnik': True, # add the OSM mapnik baselayer
'osmStamenToner': True, # add the OSM Stamen Toner baselayer
'print': True # activate the print tool
}
my_layer_options = {
'MY LAYER NAME': {
'title': 'My new title', # change title
'popup': True, # active popup
'cached': True, # activate server cache
'singleTile': False, # set tiled mode on
'imageFormat': "image/jpeg", # set image format
'toggled': False # do not display the layer at project startup
}
}
json_content = lv.to_json(
p_global_options=my_global_options,
p_layer_options=my_layer_options
)
print(json_content)
# get the configuration as dictionary
dic_content = lv.lizmap_json_config
# Exit
QgsApplication.exitQgis()
app.exit()