# Zoom Levels

When using a Mercator Projection on a tile-based system, it is better to talk about how many meters a pixel represents rather than to calculate the scale of the map at a certain zoom level.

Note that due to the limitations of Mercator Projection, the ordinate y becomes infinite at the poles, and the map must be truncated at some latitude less than ninety degrees. This needs to be done symmetrically. Our map is truncated at 80ºN and 66ºS with the result that European countries are moved towards the center of the map.

For example, at zoom level 0 where the whole world consists of a single tile 256 pixels wide, we can calculate meters by pixel (m/px) using an Earth radius of 6372.7982km as 156,412. That would yield an approximated scale of 1:500 Mill. (taking the scale as an approximate size comparison referring to distances on the equator). As the map scale will depend on the monitor, we have used a monitor with a 0.3 mm / pixel.

Below is a table with approximated values for the zoom level correspondence to scale.

zoom level scale (m/pixel)
0 156,412
1 78,271.52
2 39,135.76
3 19,567.88
4 9,783.94
5 4,891.97
6 2,445.98
7 1,222.99
8 305.75
9 305.75
10 152.87
11 76.44
12 38.22
13 19.11
14 9.55
15 4.78
16 2.39
17 1.19
18 0.60
19 0.30
20 0.15

Nevertheless, you can also use a formula to calculate the meters per pixel for 256 pixel tiles. The distance represented by one pixel (S) is given by:

S=C*cos(y)/2^(z+8)


where:

C is the equatorial circumference of the Earth,
z is the zoom level,
y is the latitude of the requested point in degrees.

Since the Earth is actually ellipsoidal, there will be a slight error in this calculation (0.3% maximum).