How Map Tiles Work
🎯 Introduction
By the end of this article, you will be able to read a tile URL and explain why maps do not load the entire world at once.
🧩 What Is a Tile?
A tile is an image or data block covering a small geographic extent. A map service splits a large map into many tiles, and the browser requests only those near the current viewport.
Tiles reduce the data transferred and rendered in a single request, allowing the map to load only newly visible areas as users pan.
Downloading an entire world map would require a large file and repeated processing of invisible content while zooming. Loading tiles lets panning and zooming fetch only newly visible areas.
🗼 Tile Pyramids and Zoom
A tile pyramid provides different numbers of tiles at different levels of detail for each zoom level. Higher zoom levels generally show a closer view and require more detailed tiles.
Tile pyramids provide overview data for distant views and detailed data for close views, avoiding the transfer of equally complex maps at every zoom level.
A tile URL often looks like /{z}/{x}/{y}.png: z is the zoom level, x is the column from west to east, and y is the row from north to south. XYZ is a common convention; TMS typically counts y from south to north.
In a global square tile grid, zoom level z typically has 2^z tiles in each direction, or about 4^z tiles in total. The browser calculates the required x and y values from the viewport rather than downloading the whole level.
256×256 and 512×512 describe the pixel dimensions of a tile image. A 512-pixel tile does not automatically add a zoom level; the service must still specify its levels and resolutions.
🧾 Summary
- Tiles divide a large map into small pieces.
- z identifies zoom; x and y identify tile position.
- XYZ and TMS mainly differ in the y direction.
- The browser uses the viewport to determine which tiles to request.
❓ Knowledge Check
Q1: Does a higher zoom level always produce a clearer map?
It usually requests more detailed data, but clarity also depends on whether the service provides that level.
Q2: Are tiles always images?
No. They can also contain vector data.
🧪 Exercise
Find a tile URL, identify z, x, and y, and determine whether it uses XYZ or TMS.
// Write your code here
🎉 You now understand the basics of loading maps in tiles!
Transformations and Misalignment
Understand 4326, 3857, WGS84, GCJ-02, BD-09, coordinate order, and unit errors, and learn how to diagnose map misalignment.
Raster and Vector Tiles
Distinguish raster tiles, vector tiles, MVT, and PBF, and understand why large vector datasets should not be loaded as one huge GeoJSON file.
