Web Map Kit › QGIS to PMTiles
How to export QGIS layers to PMTiles vector tiles
PMTiles packs a whole set of vector tiles into one file that a browser can read piece by piece. No tile server, no database: upload one file and your map loads only what's on screen.
Short answer. In QGIS, run Processing → Vector tiles → Write Vector Tiles (MBTiles), then convert the result with the free pmtiles tool: pmtiles convert layers.mbtiles layers.pmtiles. Or use tippecanoe on GeoJSON exports. Or let the Web Map Kit plugin do it in one click, including your styling, a ready web viewer and the upload.
Why PMTiles?
- One file. All zoom levels and layers live in a single
.pmtilesfile instead of thousands of tile files. - No server. The browser fetches just the bytes it needs with HTTP range requests, so plain static hosting works: Cloudflare R2, Amazon S3, or GitHub Pages for small files.
- Fast with big data. Only the tiles on screen load, so tens of thousands of features stay smooth, even on a phone. Sending whole layers as GeoJSON gets slow long before that.
Method 1: QGIS's vector tile writer + the pmtiles tool
- Open Processing → Toolbox and search for Write Vector Tiles (MBTiles).
- Add your layers, set the minimum and maximum zoom (for a city, roughly 10–16; for a country, 4–12; for the world, 0–8) and choose an output
.mbtilesfile. - Install the pmtiles command-line tool (a single download) and convert:
pmtiles convert layers.mbtiles layers.pmtiles
pmtiles show layers.pmtiles # check zoom levels and layer names
What you don't get: the QGIS styling. The tiles hold geometry and attributes only; you write the colours again as a MapLibre style.
Method 2: tippecanoe
For very large datasets, tippecanoe gives the most control over simplification and feature dropping, and writes PMTiles directly. Export each layer from QGIS as GeoJSON (in EPSG:4326), then:
tippecanoe -o layers.pmtiles -zg --drop-densest-as-needed \
-L roads:roads.geojson -L buildings:buildings.geojson
tippecanoe runs on macOS and Linux (on Windows, through WSL). As with method 1, the styling is up to you.
Method 3: Web Map Kit (styling, viewer and upload included)
Web Map Kit is our QGIS plugin ($17 once). It does methods 1 and 2's work inside QGIS and then goes further:
- picks the zoom range for your data and fixes broken low-zoom tiles that QGIS's writer can produce,
- copies your single, categorized and graduated styles, proportional circles, labels and field aliases,
- adds a mobile-friendly MapLibre viewer with legend, popups and search,
- uploads it all to your own Cloudflare R2 bucket (free tier: 10 GB, no bandwidth fees) and gives you the link.
See it on real data: 35,000 power plants and US tornado paths since 1950, both one PMTiles file each.
Hosting and showing a PMTiles file yourself
- Upload the file to storage that supports range requests. On Cloudflare R2, connect a public domain to the bucket and add a CORS rule allowing
GETandHEADfrom your site. - Show it with MapLibre GL JS and the pmtiles JavaScript library:
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
<script src="https://unpkg.com/pmtiles/dist/pmtiles.js"></script>
<script>
const protocol = new pmtiles.Protocol();
maplibregl.addProtocol("pmtiles", protocol.tile);
const map = new maplibregl.Map({
container: "map",
style: { version: 8, sources: {
data: { type: "vector", url: "pmtiles://https://maps.example.com/layers.pmtiles" } },
layers: [{ id: "roads", type: "line", source: "data", "source-layer": "roads",
paint: { "line-color": "#0f766e", "line-width": 1.5 } }] }
});
</script>
The source-layer names are your layer names from the export step (check them with pmtiles show).
Questions
Can QGIS export PMTiles directly?
QGIS writes vector tiles to MBTiles (or a folder of tiles); converting MBTiles to PMTiles takes one pmtiles convert command. Web Map Kit does both steps inside QGIS.
Do I need a tile server?
No. PMTiles is read with HTTP range requests from any static hosting that supports them.
Which zoom levels should I use?
Go as deep as your data's detail needs and no deeper: every extra zoom level roughly quadruples the number of tiles. Streets and parcels need 15–16; countries and regions 8–10.
Is PMTiles the same as MBTiles?
Both hold the same tiles. MBTiles is a SQLite database and needs a server to read it; PMTiles is designed to be read straight from static storage.