The URL structure for this API is straightforward, and is instantly recognisable to anyone familiar with the OpenStreetMap tile numbering convention. An example URL of an area in Berlin:
So let’s break that down into constituent parts:
- the server we’re getting the image from. We have [abc]-subdomains to allow parallel downloads – you get exactly the same tiles whether you access a.tile.cloudmade.com, b.tile.cloudmade.com, c.tile.cloudmade.com or simply just tile.cloudmade.com. Parallel downloads are a useful technique to get around the simultaneous image-connection limits in many browsers – we’re happy to take all the traffic you want to send!
- the API key. This one is ours – you need to substitute it with your own! You generate an API key on your account page.
- the style id. We provide different cartographic styles, and you choose between them. Try changing the style id to ‘2’ to see the difference this can make.
- the dimensions of the tile, in pixels. We provide tiles in the standard size of 256×256, and also 64×64 – these can be especially useful for you if your application runs on small-screen mobile devices.
- the last three numbers specify the exact tile you are looking for. How these work is described in examples, and it’s exactly the same as other providers including OSM.