Zoom levels · MapLibre math

Zoom is a pyramid, not a stretch.

A vertical dial, a wireframe pyramid, and live numbers for the choices MapLibre actually makes: tileSize, vector extent, zoom offsets, and overzoom.

3/2/3 ≈ -67.500°, 21.943° · pinned Manhattan
World · Mercator · 8² 3/2/3

Coarse land GeoJSON in Web Mercator. Drawn grid caps at 32²; the red cover tracks the true tile — at high z a shrinking pin with a callout arrow.

Tile pyramid wireframe
z0 · 1²z1 · 2²z2 · 4²z3 · 8²z4 · 16²z5 · 32²

Each step multiplies tile count by four. Tap a slab to jump. Overzoom past a source maxzoom reuses the top slab, scaled.

Specimen 3/2/3
OpenStreetMap tile 3/2/3

Parent 2/1/1 · child index 2 of 4

MapLibre knobs

Same z, different contracts.

Switch the format MapLibre is speaking. Raster cares about tileSize (default 512). Vector cares about local extent (usually 4096). A zoom offset shifts which file URL is requested.

Mode
tileSize
zoomOffset
Tile ground width 5.01 Mm

Equator · one XYZ square at z3. Independent of tileSize / extent.

Meters / pixel 20 km

circumference / (2^z · tileSize). With tileSize 256, one screen sample covers this at the equator.

Source zoom bias +1 → z4

MapLibre’s world is 512-based. A 256px source biases canonical tile zoom by log₂(512/256) = 1, then zoomOffset 0.

World tiles 64

23 × 23 squares cover the Mercator world.

map.addSource('xyz', {
  type: 'raster',
  tiles: ['https://example/{z}/{x}/{y}.png'],
  tileSize: 256, // MapLibre default is 512
  maxzoom: 19
});
// camera z3 → request ~z4 (bias 1, offset 0)

Raster datasets

Where native pixels sit in the pyramid.

A COG or imagery layer has a ground sample distance. Below that zoom, many native pixels collapse into one tile pixel. Above it, you are inventing detail (or overzooming).

Native GSD
Display tileSize

Sentinel-2 ~10 m GSD

Match zoom ~z13.9

At current z3 ~1957 native px / tile px

one display tile pixel @ z31,957×1,957 native samples collapse into this pixel

Scale ladder

Where z usually sits.