TomTom Maps use the Spherical Mercator projection coordinate system (EPSG:3857).
Zoom levels
The world is divided into square tiles.
Maps Raster
Map tiles has 23 zoom levels, numbered 0 through 22.
Satellite tiles has 20 zoom levels, numbered 0 through 19.
Hillshade tiles has 14 zoom levels, numbered 0 through 13.
Maps Vector has 23 zoom levels, numbered 0 through 22.
At zoom level 0, the entire world fits on a single tile:
Zoom level 1 uses 4 tiles to render the world: a 2 x 2 square.
Each subsequent zoom level quad divides the tiles of the previous one, creating a grid of 2zoom x 2zoom. For example, zoom level 22 is a grid 222 x 222, or 4,194,304 x 4,194,304 tiles (result: 17,592,186,044,416 in total).
To discover the real-world size of a single tile on a given zoom level, we can use the formula circumference of earth / 2zoom level that produces number of meters per tile side, where the circumference of the earth equals 40,075,017 meters. The full data table of values for zoom levels is here:
zoom level
meters/pixel
meters/tile side
0
156543
40075017
1
78271.5
20037508
2
39135.8
10018754
3
19567.88
5009377.1
4
9783.94
2504688.5
5
4891.97
1252344.3
6
2445.98
626172.1
7
1222.99
313086.1
8
611.5
156543
9
305.75
78271.5
10
152.87
39135.8
11
76.44
19567.9
12
38.219
9783.94
13
19.109
4891.97
14
9.555
2445.98
15
4.777
1222.99
16
2.3887
611.496
17
1.1943
305.748
18
0.5972
152.874
19
0.2986
76.437
20
0.14929
38.2185
21
0.074646
19.10926
22
0.037323
9.55463
Tile grid
Tiles are called by zoom level and the x and y coordinates corresponding to the tile's position on the grid for that zoom level.
When determining which zoom level to use, remember that each location is in a fixed position on its tile.
This means that the number of tiles needed to display a given expanse of territory is dependent on the specific placement of zoom grid on the world.
For instance, if there are two points 900 meters apart, it may only take three tiles to display a route between them at zoom level 17.
However, if the western point is on the right side of its tile, and the eastern point on its left side, it may take four tiles as shown in the following diagram:
Once the zoom level is determined, the x and y coordinate values can be calculated:
The top-left tile in each zoom grid is
**x=0**
,
**y=0**
.
The bottom-right tile is at
**x=2 zoom -1**
,
**y=2 zoom -1**
.
Here is the zoom grid for zoom level 1:
Coordinates conversion
Convert latitude/longitude coordinates to tile z/x/y coordinates.
Coordinates
Zoom level
Result
ConvertConvert
Latitude/longitude to tile z/x/y
Select...
1functionlatLonToTileZXY(lat, lon, zoomLevel){
2constMIN_ZOOM_LEVEL=0
3constMAX_ZOOM_LEVEL=22
4constMIN_LAT=-85.051128779807
5constMAX_LAT=85.051128779806
6constMIN_LON=-180.0
7constMAX_LON=180.0
8
9if(
10 zoomLevel ==undefined||
11isNaN(zoomLevel)||
12 zoomLevel <MIN_ZOOM_LEVEL||
13 zoomLevel >MAX_ZOOM_LEVEL
14){
15thrownewError(
16"Zoom level value is out of range ["+
17MIN_ZOOM_LEVEL.toString()+
18", "+
19MAX_ZOOM_LEVEL.toString()+
20"]"
21)
22}
23
24if(lat ==undefined||isNaN(lat)|| lat <MIN_LAT|| lat >MAX_LAT){