Coder Social home page Coder Social logo

sylsta / lizmap-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 3liz/lizmap-plugin

0.0 2.0 0.0 9.11 MB

Lizmap plugin for QGIS, allowing to publish QGIS maps to Lizmap Web Client

Makefile 2.03% Python 87.65% HTML 9.58% QMake 0.14% Shell 0.60%

lizmap-plugin's Introduction

logoLizmap 3.0.0

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.

Authors

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.

Contributors

  • 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

Installation

from github repository:

  1. Clone the repo: git clone [email protected]:3liz/lizmap-plugin.git
  2. cp lizmap-plugin ~/.qgis2/python/plugins
  3. cd ~/.qgis2/python/plugins
  4. mv lizmap-plugin lizmap

or from QGIS application:

  1. Plugins menu -> Manage and Install Plugins...
  2. Select LizMap plugin from Not installed list
  3. Install plugin

Documentation

Translation

You can use the Makefile to update and compile the strings for translation.

# Update strings
make transup

# Compile
make transcompile

License

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.

API

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()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.