Export your QGIS layers to interactive web maps with Leaflet!
Universal Map2web is a QGIS plugin that exports your vector layers to interactive web maps with Leaflet, faithfully preserving QGIS symbology and styles.
https://www.youtube.com/watch?v=6DIGVI7V55E
The complete user manual is available here: Download the Universal Map2web User Manual (PDF)
- 1 QGIS symbology preservation (colors, widths, opacities, line styles)
- 2 Support for all renderers: Single, Categorized, Graduated, Rule-based
- 3 Automatic QGIS labeling
- 4 Customizable popups per layer
- 5 Advanced attribute filtering
- 6 Colored point clustering
- 7 Integrated tools: Measure, Search, Geolocation, Fullscreen, Scale bar, MiniMap, Print
- 8 Interface themes: Light, Dark, Professional, Colorful
- 9 Customizable logo and header color
- 10 Built-in local server (avoids CORS issues)
- 11 Export to PNG, PDF and CSV
- 12 Multi-language support (English/French)
- 13 Dynamic PostgreSQL/PostGIS mode: layers already connected to a PostGIS database in QGIS can stay live on the exported web map instead of being frozen into a static GeoJSON file
For layers already connected to PostgreSQL/PostGIS in QGIS, you can enable "Load PostGIS layers dynamically from PostgreSQL (instead of a static export)" in the export dialog. When enabled:
- The plugin reuses the connection already configured in QGIS (no credentials re-entered in the plugin)
- A single
get_data.phpendpoint plus a protecteddb_config.phpare generated in the export folder - A random API key is generated for each export to restrict access to the endpoint
.htaccessblocks direct access todb_config.php- The web map queries the database live (with optional bounding-box filtering), so it always reflects the current data instead of a snapshot taken at export time
- Layers not connected to PostgreSQL, or when this option is left unchecked, are still exported as static GeoJSON as before
Requirement: a PHP-capable web server with the pdo_pgsql extension is needed to host the exported site in this mode (a plain static file host is not enough).
- Open QGIS
- Go to
Plugins→Manage and Install Plugins... - Search for
Universal Map2web - Click
Install
- Download the
universal_map2webfolder - Copy it to the QGIS plugins folder:
- Windows:
C:\Users\YourName\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ - Linux:
~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ - Mac:
~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/
- Windows:
- Activate the plugin in QGIS
- Click the
Universal Map2webicon in the toolbar - Select the layers to export
- Customize options (title, logo, theme, language, etc.)
- Click
OK - The map opens automatically in your browser
- QGIS 3.16 or higher
- Modern web browser (Chrome, Firefox, Edge, Safari)
This project is licensed under the GNU GPL v2. See the LICENSE file for details.
Jean-baptiste Bazikité KIBORA
- Email : jeanbaptiste.kibora@tic.gov.bf
- GitHub : @geomatic-web
- QGIS - The best open-source GIS
- Leaflet - The JavaScript mapping library
- qgis2web - Inspiration source
Universal Map2web est une extension QGIS qui exporte vos couches vectorielles en cartes web interactives avec Leaflet, en préservant fidèlement la symbologie et les styles de votre projet QGIS.
La documentation complète disponible ici: Télécharger la version pdf (PDF)
- 1 Préservation de la symbologie QGIS (couleurs, épaisseurs, opacités, styles de ligne)
- 2 Support de tous les renderers : Simple, Catégorisé, Gradué, Règle
- 3 Étiquetage QGIS (labeling) automatique
- 4 Popups personnalisables par couche
- 5 Filtre avancé par attribut
- 6 Cluster de points colorés
- 7 Outils intégrés : Mesure, Recherche, Géolocalisation, Plein écran, Échelle, MiniMap, Impression
- 8 Thèmes d'interface : Clair, Sombre, Professionnel, Coloré
- 9 Logo et couleur d'en-tête personnalisables
- 10 Serveur local intégré (évite les problèmes CORS)
- 11 Export PNG, PDF et CSV
- 12 Support multilingue (Anglais/Français)
- 13 Mode PostgreSQL/PostGIS dynamique : les couches déjà connectées à une base PostGIS dans QGIS peuvent rester en direct sur la carte web exportée, au lieu d'être figées dans un fichier GeoJSON statique
Pour les couches déjà connectées à PostgreSQL/PostGIS dans QGIS, vous pouvez activer « Charger dynamiquement les couches PostGIS depuis PostgreSQL (au lieu d'un export figé) » dans la boîte de dialogue d'export. Lorsque cette option est activée :
- L'extension réutilise la connexion déjà configurée dans QGIS (aucun identifiant à ressaisir dans le plugin)
- Un unique point d'accès
get_data.phpainsi qu'un fichierdb_config.phpprotégé sont générés dans le dossier d'export - Une clé API aléatoire est générée à chaque export pour restreindre l'accès à ce point d'accès
- Le fichier
.htaccessbloque l'accès direct àdb_config.php - La carte web interroge la base de données en direct (avec un filtrage optionnel par emprise géographique), ce qui garantit des données toujours à jour plutôt qu'un instantané figé au moment de l'export
- Les couches non connectées à PostgreSQL, ou lorsque cette option reste décochée, continuent d'être exportées en GeoJSON statique comme auparavant
Prérequis : un serveur web compatible PHP avec l'extension pdo_pgsql est nécessaire pour héberger le site exporté dans ce mode (un simple hébergement de fichiers statiques ne suffit pas).
- Ouvrez QGIS
- Allez dans
Extensions→Gérer et installer les extensions... - Recherchez
Universal Map2web - Cliquez sur
Installer
- Téléchargez le dossier
universal_map2web - Copiez-le dans le dossier des plugins QGIS :
- Windows :
C:\Users\VotreNom\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ - Linux :
~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ - Mac :
~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/
- Windows :
- Activez l'extension dans QGIS
- Cliquez sur l'icône
Universal Map2webdans la barre d'outils - Sélectionnez les couches à exporter
- Personnalisez les options (titre, logo, thème, etc.)
- Cliquez sur
OK - La carte s'ouvre automatiquement dans votre navigateur
- QGIS 3.40 ou supérieur
- Navigateur web moderne (Chrome, Firefox, Edge, Safari)
Ce projet est sous licence GNU GPL v2. Voir le fichier LICENSE pour plus de détails.
Jean-baptiste Bazikité KIBORA
- Email : jeanbaptiste.kibora@tic.gov.bf
- GitHub : @geomatic-web


