These map tiles follow 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.

Tile naming

All tiles are 256 x 256 pixel PNG files, layed 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 named as {z}/{x}/{y}.png, 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.png and looks like this:

The 8038th tile on the 5423th row of the 14th zoom is named 14/8038/5423.png 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.

Zoom levels

Tiles are available on zoom levels 0 through 22.

A note on OGC TMS systems

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.

Tileserver Subdomains (for example [abc].tile)

One of the features of modern browsers is a default restriction on the number of image requests that will be made simultaneously to the one server. This makes sense for most scenarios, but for a high-throughput map tile server, that can slow things down unnecessarily, and is especially noticeable on high-latency networks, and where the maps occupy a large part of the screen. It’s common to max out the limit in simultaneous requests - normally only 8 images or thereabouts per server.

To work around these limitations, we can make simultaneous requests to multiple domain names, even if they all ultimately point to the same server. By convention they are labeled a, b, and c - so the following three URLs all point to the same server, and give the same tile in response.<insert-your-apikey-here><insert-your-apikey-here><insert-your-apikey-here>

The subdomains are entirely optional, so if you don’t need this subdomain trick, you can drop them and instead request:<insert-your-apikey-here>

Check the documentation of the map display library that you are using to see if it supports multiple subdomains for faster parallel requests.