Our Map Tiles API follows the standard Web Mercator tile format - a.k.a. Spherical Mercator, OpenStreetMap or Google tiles. They are usually supported natively by any map library that you are using, but read on if you want to know more details.
All tiles are 256 x 256 pixel PNG files, laid out on a square grid, numbered starting with 0 at the top left of the globe. At the lowest zoom level, zoom 0, one tile covers the entire world. The tiles are numbered as {z}/{x}/{y}
, where z is zoom, x is the tile number from left to right, and y is the tile number from top to bottom. For example, the solitary tile on zoom 0 is named 0/0/0
and looks like this:
The 8038th tile on the 5423th row of the 14th zoom is numbered 14/8038/5423
and looks like this
The maximum tile number on a particular zoom is (2 ^ z) - 1
.
The projection is Spherical Mercator - known by the projection code EPSG:3857
or by previously used codes EPSG:900913
and EPSG:3785
. This covers most of the globe (between 85°N and 85°S) and distorts it slightly to fit into a convenient square. You can convert from pixels to WGS84 coordinates (aka EPSG:4326
aka GPS coordinates) using some not-particularly complex maths, but I’ll leave that for elsewhere to document.
Tiles are available on zoom levels 0 through 22.
The OpenGeoSpatial Tiled Map System (TMS) is similar to the above, except that numbering starts from the bottom left instead of the top left. Trust me, this incompatibility is very, very annoying. Most libraries that support TMS also support OSM-format numbering - check the documentation for your library.