Map Tile
Purpose
The Maps Raster Tile API endpoint renders map data that is divided into gridded sections called tiles. Tiles are square images in various sizes which are available at 23 different zoom levels, ranging from 0 to 22. For zoom level 0, the entire earth is displayed on one single tile, while at zoom level 22, the world is divided into 244 tiles. See the Zoom Levels and Tile Grid.
Run this endpoint
You can easily run this and other endpoints. Go to the TomTom API Explorer page and follow the directions.
Tile layers and styles
The Maps Raster service supports the following tile layers: basic, hybrid, and labels. Each can be served in two different styles: main and night.
Basic tiles contain mapping data such as polygons, road shapes, borders and labels. In addition to the basic map tiles, the service provides overlay tiles. These are partially transparent tiles containing map geometry or labels but not the full map. They can be layered with other TomTom or third party map tiles to create consolidated views:
- The labels overlay provides the same label information as the standard map tile. It can be used in situations where traffic tubes or other overlaid information covers the labels on the base map layer. The labels are precisely placed to align with the labels on the standard layer.
- The hybrid overlay provides all the features from the map data except geographic polygons. It contains borders, roads, and labels, and can be overlaid on other tiles (such as satellite imagery) to produce hybrid tiles displaying TomTom map data.
Because overlaying requires transparency, all overlay tiles must be requested with a format of png.
Tile Sizes
The following tiles sizes are currently supported:
- 256 x 256 pixels: This is better suited for lower resolution displays and clients sensitive to internet data transfer usage.
- 512 x 512 pixels: This is created for displays with high resolutions.
Request data
HTTPS method: GET
- Constants and parameters enclosed in curly brackets { } must be replaced with their values.
- Please see the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
URL format
https://{baseURL}/map/{versionNumber}/tile/{layer}/{style}/{zoom}/{X}/{Y}.{format}?key={Your_API_Key}&tileSize={tileSize}&view={geopoliticalView}&language={language}
curl command format
curl 'https://{baseURL}/map/{versionNumber}/tile/{layer}/{style}/{zoom}/{X}/{Y}.{format}?key={Your_API_Key}&tileSize={tileSize}&view={geopoliticalView}&language={language}'
Request parameters
These parameters are used in calls to generate all tile layers.
- Required parameters must be used or the call will fail.
- Parameters and values are case-sensitive.
- Optional parameters may be used.
Required parameters | Description |
---|---|
string | The base URL for calling TomTom services. Values:
|
string | The version of the service to call. Value: The current version is |
string | Layer of the tile to be rendered. Values:
|
string | Style of the tile to be rendered. Values:
|
integer | Zoom level of the tile to be rendered. Value: |
integer | The x coordinate of the tile on a zoom grid. Value: 0..2 zoom -1 |
integer | The y coordinate of the tile on a zoom grid. Value: 0..2 zoom -1 |
string | The format of the response. Values:
Note: The jpg format is only supported for |
string | An API Key valid for the requested service. Value: Your valid API Key. |
Optional parameters | Description |
---|---|
integer | The tile size dimension in pixels. Default value: Other value: |
string | A geopolitical view. Usage of a value outside of the given set will result in the server sending a HTTP 400 response. Default value: See the following Default view mapping section. Other values:
|
string | The language to be used for labels returned in the response. It should be one of the supported IETF language code tags described here or one of the custom language tags. When data in a specified language is not available for a specific label, the default language is used. Default value: Other values: See the following List of supported languages. |
Request headers
The following table lists HTTP request headers of particular interest to clients of the Maps Raster Tile API endpoint.
Optional headers | Description |
---|---|
Contains the content encoding (usually a compression algorithm), that the client is able to understand. Value: | |
Contains an identifier for a specific version of resource. The server will send back the requested resource, with a 200 HTTP status code, only if it doesn't have an ETag matching the given one. Value: | |
Tracking-ID | Specifies an identifier for the request. It can be used to trace a call.
The value must match the regular expression
Value: |
Default language algorithm
The best match will be chosen based on following algorithm.
- Every IETF language subtag provided in the
language
parameter is being matched from left to right. A partial match is allowed. For example:- All requested language subtags exactly match when the requested language is selected.
- If the requested primary language subtag does not have a match for a region , but a script subtag is available for other primary language subtags, then this other laguage will be used.
- If there are multiple matches for a region, then the one with the highest priority is used.
- If there is no match then
NGT
(Neutral Ground Truth) is used.
List of supported languages
Language name | Language tag |
---|---|
Neutral Ground Truth (custom) |
Official languages for all regions in local scripts if available. |
Neutral Ground Truth - Latin exonyms (custom) |
Latin script will be used if available. |
Arabic |
|
Bulgarian |
|
Chinese (Taiwan) |
|
Chinese (Simplified) |
|
Czech |
|
Danish |
|
Dutch |
|
English (Australia) |
|
English (Canada) |
|
English (Great Britain) |
|
English (New Zealand) |
|
English (USA) |
|
Finnish |
|
French |
|
German |
|
Greek |
|
Hungarian |
|
Indonesian |
|
Italian |
|
Korean |
|
Lithuanian |
|
Malay |
|
Norwegian |
|
Polish |
|
Portuguese (Brazil) |
|
Portuguese (Portugal) |
|
Russian written in the Cyrillic script. |
|
Russian written in the Latin script. |
|
Russian written in the Cyrillic script. Cyrillic script used where possible. |
|
Slovak |
|
Slovenian |
|
Spanish (Castilian) |
|
Spanish (Mexico) |
|
Swedish |
|
Thai |
|
Turkish |
|
Default view mapping
Default view is recognised based on the country the request came from.
Country | Default view |
---|---|
Argentina |
Other available views: |
India |
Other available views: None |
Morocco |
Other available views: |
Pakistan |
Other available views: |
Russia |
Other available views: |
Türkiye |
Other available views: |
China |
Other available views: |
Bahrain, Kuwait, Oman, Qatar, Saudi Arabia, the United Arab Emirates |
Other available views: |
Others |
Other available views: |
- Only available under kr-api.tomtom.com , see Available region specific contents.
Host Name Cycling
Most web browsers have a default limitation on the number of active connections that can be allowed to each host. This means if map tiles are being loaded via the api.tomtom.com host name, they will be loaded one at a time. A trick that can be used to get around this limitation is to cycle through the hosts we have created as aliases. These host names are:
- a.api.tomtom.com
- b.api.tomtom.com
- c.api.tomtom.com
- d.api.tomtom.com
By cycling through these four different host names, the web browser will be tricked into retrieving four map tiles at a time rather than just one. This will significantly speed up the performance of map rendering.
For instance, if four map tiles are being requested at zoom level one, you would request the first one as:
https://a.api.tomtom.com/map/1/tile/basic/main/1/0/0.png?key={Your_API_Key}
The second would be:
https://b.api.tomtom.com/map/1/tile/basic/main/1/0/0.png?key={Your_API_Key}
and so on up until d.api.tomtom.com. When more than four tiles are being requested, start back again at a.api.tomtom.com.
Response data
The Maps Raster API, for a single request, returns one square tile in png or jpg format.
256 x 256 pixels
Layer | Main | Night |
---|---|---|
basic | ||
hybrid | ||
labels |
512 x 512 pixels
Layer | Main |
---|---|
basic | |
labels |
Response examples
Example 1
**Whole world at zoom = 0
**
Request | Response |
---|---|
Basic main zoom = 0:
| |
Basic night zoom = 0:
| Note: There is no data for labels and roads at this zoom level, so any different combination of layer and style will cause a transparent tile to be returned. |
Example 2
**Europe at zoom = 4
**
Request | Response |
---|---|
Basic main zoom = 4:
| |
Hybrid main zoom = 4:
| |
Labels main zoom = 4:
| |
Basic night zoom = 4:
| |
Hybrid night zoom = 4:
| |
Labels night zoom = 4:
|
Example 3
**Amsterdam at zoom = 17
**
Request | Response |
---|---|
Basic main zoom = 17:
| |
Hybrid main zoom = 17:
| |
Labels main zoom = 17:
| |
Basic night zoom = 17:
| |
Hybrid night zoom = 17:
| |
Labels night zoom = 17:
|
Error response
The Map Display API Raster service for an invalid request returns a response body in XML or JSON format. The XML format is returned by default. To have an error response returned in JSON format, application/json
has to be specified in the Accept
HTTP request header.
Error response field structure
Field | Description |
---|---|
object | Main object of the error response. |
string | One of a server-defined set of error codes. |
string | A human-readable description of the error code. |
Error response example
1{2 "detailedError": {3 "code": "BAD_REQUEST",4 "message": "Invalid tile position arguments"5 }6}
1<errorResponse description="Invalid tile position arguments" errorCode="400" version="1.0.54-mascoma">2 <code>BAD_REQUEST</code>3 <message>Invalid tile position arguments</message>4 </detailedError>5</errorResponse>
Response codes
Code | Meaning & possible causes |
---|---|
| OK |
| Not Modified : The tile has not been modified. This code is
returned when the |
| Bad request : Probably malformed syntax.
|
| Forbidden : The supplied API Key is not valid for this request. The requested view is not available in the country from where the request was sent. |
| Too Many Requests : Too many requests were sent in a given amount of time for the supplied API Key. |
| Internal Server Error : There is a problem with the TomTom Maps Raster Tile service. |
| Service currently unavailable. |
Response headers
The following table lists HTTP response headers of particular interest to clients of the Map Display API Raster Tile endpoint.
Header | Description |
---|---|
The Maps Raster Tile API allows cross-origin resource sharing (CORS). Value: | |
Contains directives for a caching mechanism. Value: | |
Indicates which encodings were applied to the Response body. Value: | |
Contains information about the size of the response body. Value: | |
Indicates the media type of the resource returned. Values:
| |
Contains the date and time at which the message was originated. Value: | |
Contains an identifier for a specific version of resource. Value: | |
Contains the date after which the response is considered outdated. Value: | |
Specifies the form of encoding used to safely transfer Response to the user. If this header is specified, Content-Length header will be absent. Value: | |
Tracking-ID | An identifier for the request. If the
Tracking-ID header was specified in
the request, it is replicated in the response. Otherwise, it is
generated automatically by the service. For details check
RFC 4122. Value: |