Installation
From the QGIS plugin repository
- Open QGIS
- Menu
Plugins→Manage and Install Plugins - Search for "Universal Map2web"
- Click Install
Or view the plugin page directly: plugins.qgis.org/plugins/universal_map2web
From GitHub
- Download the ZIP from GitHub
- QGIS →
Plugins→Install from ZIP - Select the downloaded ZIP file
- Restart QGIS if prompted
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
- Check the layers to export (use "Select all" / "Deselect all" / "Invert" to speed this up)
- 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
- Once everything is configured, click "OK"
- Choose the destination folder
- 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.
| Option | Effect on the exported map |
|---|---|
| Address search | Adds a search bar to locate an address on the map |
| GPS geolocation | Adds a button to center the map on the visitor's current position |
| Measure (distance/area) | Adds interactive distance and area measurement tools |
| Print button | Adds a button that triggers the browser's print dialog for the map |
| Fullscreen mode | Adds a control to expand the map to fullscreen |
| Overview (MiniMap) | Displays a small overview map in a corner of the main map |
| Scale bar | Displays a graphic distance scale (enabled by default) |
| Cursor position | Displays live latitude/longitude under the mouse pointer |
| Attribution | Displays the map/library credits (enabled by default) |
| Advanced filter | Adds 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.
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
- Select a layer
- Select a field
- Select an operator
- Type or click a value
- Click "Apply" — matching features are highlighted on the map
Available operators
| Operator | Meaning |
|---|---|
= | equal to |
≠ | different from |
⊃ | contains |
| starts with | text starts with the given value |
> | greater than |
< | less than |
≥ | greater than or equal to |
≤ | less than or equal to |
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
- In the export dialog, check "Load PostGIS layers dynamically from PostgreSQL (instead of a static export)"
- The plugin automatically reuses the connection already configured in QGIS — no credentials need to be re-entered
- Export as usual — layers not connected to PostgreSQL, or left unchecked, are still exported as static GeoJSON
What gets generated
- A single
get_data.phpendpoint that serves live feature data to the web map - A protected
db_config.phpfile holding the database connection details - A random API key, generated for each export, restricting access to the
get_data.phpendpoint - An
.htaccessfile that blocks direct access todb_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.
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.
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
- 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.htmlmanually from the export folder in your browser
The legend or some labels stay in the wrong language
- Make sure QGIS's interface language is set the way you want under
Settings→Options→General - Restart QGIS after changing the language so the plugin reloads its translations
A layer doesn't appear in the exported map
- 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
- 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
- Confirm the host is a PHP server with the
pdo_pgsqlextension enabled — a static-only host cannot runget_data.php - Make sure
db_config.phpand.htaccesswere 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
Requirements
| Component | Requirement |
|---|---|
| QGIS | 3.0 or higher (up to 4.x) |
| Browser | Chrome 90+, Firefox 88+, Edge 90+ |
| Memory | 4 GB RAM minimum |
| Internet | Required 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
QGIS Plugin Repository
Report a bug
Phone
+226 64 41 25 14