Universal Map2web

Universal Map2web

QGIS plugin to export interactive Leaflet web maps

Version 1.2.1

Installation

From the QGIS plugin repository

  1. Open QGIS
  2. Menu PluginsManage and Install Plugins
  3. Search for "Universal Map2web"
  4. Click Install

Or view the plugin page directly: plugins.qgis.org/plugins/universal_map2web

From GitHub

  1. Download the ZIP from GitHub
  2. QGIS → PluginsInstall from ZIP
  3. Select the downloaded ZIP file
  4. Restart QGIS if prompted
Requires QGIS 3.0 or higher (compatible up to QGIS 4.x). The plugin interface automatically follows the language of your QGIS installation (French / English).

Usage

1. Launch the plugin

Click on the Universal Map2web icon in the QGIS toolbar, or open it from the Web menu.

General tab

  • Choose the web library used to render the map (Leaflet)
  • Select the basemap: OpenStreetMap, Google Satellite, or a custom tile URL (e.g. https://{s}.tile.example.com/{z}/{x}/{y}.png)
  • Enable the tools you want embedded in the exported map (see Tools & Options)

Customization tab

  • Set the map title shown in the browser tab and header
  • Add an optional logo displayed in the header
  • Pick the header color
  • Choose one of the four UI themes (see Themes)

Layers tab

  1. Check the layers to export (use "Select all" / "Deselect all" / "Invert" to speed this up)
  2. For each layer, configure which attribute fields appear in the popup when a feature is clicked

Advanced tab

  • Simplify geometries — reduces vertex count for faster loading
  • Compress JSON data — smaller GeoJSON output files
  • Round coordinates — trims decimal precision
  • Load PostGIS layers dynamically from PostgreSQL — keeps layers already connected to PostgreSQL/PostGIS in QGIS live on the exported map instead of freezing them into static GeoJSON (see PostGIS Dynamic Mode)
  • Export as ZIP — packages the whole export in a single archive
  • Open automatically in browser — starts a local server and opens the map once export finishes

Wiki tab

Built-in quick-reference documentation, available in French or English depending on your QGIS language.

Exporting

  1. Once everything is configured, click "OK"
  2. Choose the destination folder
  3. The map opens automatically in your default browser (if enabled)

Tools & Options

Each tool below can be enabled or disabled independently in the General tab before export.

OptionEffect on the exported map
Address searchAdds a search bar to locate an address on the map
GPS geolocationAdds a button to center the map on the visitor's current position
Measure (distance/area)Adds interactive distance and area measurement tools
Print buttonAdds a button that triggers the browser's print dialog for the map
Fullscreen modeAdds a control to expand the map to fullscreen
Overview (MiniMap)Displays a small overview map in a corner of the main map
Scale barDisplays a graphic distance scale (enabled by default)
Cursor positionDisplays live latitude/longitude under the mouse pointer
AttributionDisplays the map/library credits (enabled by default)
Advanced filterAdds the attribute filtering panel — see Advanced Filtering

Layer management on the exported map

  • Show / hide a layer: toggle its checkbox in the legend panel
  • Point clustering: enable "Cluster points" per layer (point layers only)
  • Legend: colors and categories are generated automatically from your QGIS symbology (Simple, Categorized, Graduated, and Rule-based renderers are all supported)
  • Expand / Collapse all: quickly fold or unfold every layer group in the legend

Themes & Customization

Light

Clean, bright interface — best for printed screenshots and daytime presentations.

Dark

Low-glare dark interface, well suited for satellite basemaps and long viewing sessions.

Professional

Neutral, corporate look for official reports and institutional web maps.

Colorful

Vibrant accent colors, ideal for public-facing or promotional map dashboards.

Tip: the header color, title, and logo are independent from the theme, so you can mix your organization's branding with any of the four base themes.

Advanced Filtering

When enabled, a filter panel appears in the exported map's sidebar, letting visitors query features without touching QGIS.

How to use it

  1. Select a layer
  2. Select a field
  3. Select an operator
  4. Type or click a value
  5. Click "Apply" — matching features are highlighted on the map

Available operators

OperatorMeaning
=equal to
different from
contains
starts withtext starts with the given value
>greater than
<less than
greater than or equal to
less than or equal to
Reset: click "Reset" at any time to clear the filter and show all features again.

PostGIS Dynamic Mode New in 1.2.1

For layers already connected to PostgreSQL/PostGIS in QGIS, Universal Map2web can now keep them live on the exported web map instead of freezing them into a static GeoJSON snapshot taken at export time.

How to enable it

  1. In the export dialog, check "Load PostGIS layers dynamically from PostgreSQL (instead of a static export)"
  2. The plugin automatically reuses the connection already configured in QGIS — no credentials need to be re-entered
  3. Export as usual — layers not connected to PostgreSQL, or left unchecked, are still exported as static GeoJSON

What gets generated

  • A single get_data.php endpoint that serves live feature data to the web map
  • A protected db_config.php file holding the database connection details
  • A random API key, generated for each export, restricting access to the get_data.php endpoint
  • An .htaccess file that blocks direct access to db_config.php

How it behaves

The web map queries the database live, with optional bounding-box filtering, so visitors always see current data instead of a snapshot frozen at export time. Layers left in static mode continue to work exactly as before.

Requirement: hosting the exported site in this mode requires a PHP-capable web server with the pdo_pgsql extension enabled. A plain static file host (e.g. GitHub Pages, a basic file share) is not enough for dynamic layers — use static GeoJSON export instead in that case.
Security tip: keep the generated db_config.php and .htaccess files in place and unmodified — they are what prevents direct, unauthenticated access to your database credentials and query endpoint.

Tips and Best Practices

Keep it light

Limit exports to around 10 active layers for the best browser performance.

File size

Keep individual layers under roughly 50 MB; enable "Simplify geometries" and "Compress JSON data" for large datasets.

Coordinate system

Use WGS84 (EPSG:4326) for your project — Leaflet basemaps expect geographic coordinates.

Preview first

Check symbology and labels in QGIS before exporting — the web map mirrors your current project styling.

Popups

Only select the fields visitors actually need in the popup configuration — fewer fields means a lighter, cleaner popup.

Sharing the export

Use "Export as ZIP" to get a single archive you can upload to a web server or send to a colleague.

Troubleshooting

The map doesn't open automatically after export

Symptom: export finishes without error, but no browser window appears.
Solutions:
  • Make sure "Open automatically in browser" is checked in the Advanced tab
  • Check that your firewall or antivirus isn't blocking the local port used to preview the map
  • Open index.html manually from the export folder in your browser

The legend or some labels stay in the wrong language

Solutions:
  • Make sure QGIS's interface language is set the way you want under SettingsOptionsGeneral
  • Restart QGIS after changing the language so the plugin reloads its translations

A layer doesn't appear in the exported map

Solutions:
  • Confirm the layer is checked in the Layers tab of the export dialog
  • Make sure the layer's visibility is turned on in the QGIS Layers panel
  • Vector layers only — raster layers are not exported to Leaflet by this plugin

Colors or categories in the web map don't match QGIS

Solutions:
  • Re-check your renderer type (Simple, Categorized, Graduated, Rule-based) is fully applied in QGIS before exporting
  • Refresh the layer's symbology panel in QGIS, then re-export

PostGIS layers show no data once hosted online

Symptom: the map works locally but dynamic layers stay empty once deployed to a web server.
Solutions:
  • Confirm the host is a PHP server with the pdo_pgsql extension enabled — a static-only host cannot run get_data.php
  • Make sure db_config.php and .htaccess were uploaded alongside the rest of the export, unmodified
  • Check that the PostgreSQL server accepts remote connections from your web host, and that its firewall allows the connection
Good to know: most issues come down to browser/firewall permissions for the local preview server, or a layer's visibility/selection state in QGIS at export time.

Requirements

ComponentRequirement
QGIS3.0 or higher (up to 4.x)
BrowserChrome 90+, Firefox 88+, Edge 90+
Memory4 GB RAM minimum
InternetRequired for basemaps and web libraries (Leaflet, plugins)
Hosting (PostGIS dynamic mode only)PHP-capable web server with the pdo_pgsql extension enabled

Support and Contact