STANDARDwalkthrough

Map Tile Rendering and Zoom Levels

1 of 8
3 related
A user opens Google Maps on their phone and pinches to zoom into a neighborhood. The app needs to show the entire Earth at zoom level 0, then seamlessly transition to street-level detail at zoom level 21.
We use a quadtree tile scheme where each zoom level divides the world into a grid of square tiles. At zoom level zz, the grid contains 4z4^z tiles.
How do we serve a planet's worth of geographic data at every magnification level without melting the server?
Level 0 is a single tile covering the entire planet. Level 1 splits it into 4 tiles.
Level 18 produces 418=68.7 billion tiles4^{18} = 68.7\text{ billion tiles}. Google Maps uses 22 zoom levels (0 through 21), and each tile is addressed by a (z,x,y)(z, x, y) coordinate tuple.
Why a quadtree and not a fixed grid at the highest resolution? Because a fixed grid at level 21 would require storing all 4.4 trillion tiles, but 70% of the Earth is ocean that needs no detail beyond level 8.
The quadtree lets us pre-render only the tiles that matter and serve empty blue tiles for open ocean. This creates a tile pyramid: the base has billions of tiles at high zoom, and each level up has 4x fewer.
Total storage for the full pyramid is roughly 500 TB of pre-rendered tiles. At peak traffic, Google Maps serves around 521K tile requests per second.
A CDN absorbs 98% of those because tiles are immutable, perfectly cacheable content. Each raster tile is a 256x256 pixel PNG image.
Vector tiles encoded in Protocol Buffer format (PBF) weigh only 20 to 50 KB each, compared to 100 to 300 KB for raster PNGs. Trade-off: more zoom levels mean finer detail for the user but exponentially more storage.
Going from 21 to 22 zoom levels quadruples the tile count. Most mapping services stop at 21 because street-level detail is sufficient for navigation, and the storage cost of level 22 rarely justifies the marginal improvement.
What if the interviewer asks: how do we handle tile updates when new roads are built? We re-render only the affected tiles and their ancestors up the pyramid.
A single road change touches roughly log4(421)=21\log_4(4^{21}) = 21 tiles vertically plus a handful of neighbors, not the entire dataset.
Why it matters in interviews
Interviewers expect us to derive the tile count from 4z4^z and explain why the quadtree tile pyramid is the foundational data structure for any mapping system. Showing the 500 TB storage estimate and the 98% CDN hit ratio demonstrates that we understand the serving economics, not just the theory.
Related concepts