Each tile has 256 pixels by 256 pixels.
Scale level 0 - 1 tile. (1 x 1)
Scale level 1 - 4 tiles. (2 x 2)
Scale level 2 - 16 tiles. (4 x 4)
Level 3 image level is 64 fragments. (8 x 8)
Level 4 image level is 256 fragments (16 x 16)
For each zoom level, the x and y values ββare doubled. According to the comment 88ad the formula for the number of tiles (2 ^ zoom x 2 ^ zoom).
Hope you can do the rest of the math with a magnification level of 18. To save space, ocean tiles are not stored. They are created in response to a request.
At a zoom level of 3, tiles are numbered from 0 to 7 in the x direction (longitude) and numbered from 0 to 7 in the y direction (latitude).
Tiles begin on the US side next to the International Date Line (-180 or +180 longitude). Tile 0.0 begins at approximately 70 Β° north latitude.
See the Mercator Projection article for more details on how a sphere maps to a plane. Calculations for converting longitude and latitude to x and y coordinates are provided in the Wikipedia article.
You can match any point of the Mercator projection with a set of tiles. A tile set is a tile set with a zoom level. You need to know the zoom level to find out which tile is set for access, and to calculate which tile in the tile set should be extracted and displayed.
This Google Mapping blog post provides a formula for converting (latitude, longitude, scaling) to (x, y, scaling), where x and y are a fragment from a scaling set.