Vector Tiles
Important notes:
- This TomTom Orbis API is in public preview.
- This API is powered by TomTom Orbis Maps.
- See the TomTom Orbis Maps documentation for more information.
Purpose
The Map Display API Vector Tiles endpoint serves data on zoom levels ranging from 0
to 22
.
- For zoom level
0
, the entire earth is displayed on a single tile. - At zoom level
22
, the world is divided into 244 tiles. See the Zoom Levels and Tile Grid.
The TomTom Orbis Maps Vector Tiles endpoint delivers geographic map data packaged in a vector representation of squared sections called vector tiles.
- Each tile includes pre-defined collections of map features (points, lines, road shapes, water polygons, building footprints, etc.) delivered in one of the specified vector formats.
- The format of the tile is formally described using the protobuf schema.
- The content of the tiles and meaning of each tile layer is described in the tile layers description.
Tiles Layers and Styles
The TomTom Orbis Maps Vector Tiles endpoint supports the following tile layers: basic
. The vector data consists of layers with their own names and geometry. The client determines how to present this data to the end user, for example which colors to use for which features.
- The
basic
vector tiles contain mapping data such as polygons, road shapes, borders, labels, and road icons.
Tiles Resolution
Visible geometry is stored as coordinates in the range 0-4095
. Coordinate 0,0
is defined as the top-left corner of the tile.
Request data
HTTPS method: GET
For ease of viewing and identification:
- 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 these values. The generic URL format is as follows.
URL format
https://{baseURL}/maps/orbis/map-display/tile/{zoom}/{X}/{Y}.{format}?apiVersion=1&key={Your_API_Key}&view={view}
curl 'https://{baseURL}/maps/orbis/map-display/tile/{zoom}/{X}/{Y}.{format}?apiVersion=1&key={Your_API_Key}&view={view}'
Request parameters
The following elements are used in calls to generate all vector tile layers.
Required parameters | Description |
---|---|
| The base URL for calling TomTom services.
|
| Zoom level of the tile to be rendered. |
| The x coordinate of the tile on a zoom grid. |
| The y coordinate of the tile on a zoom grid. |
| The format of the response. |
| An API Key valid for the requested service. |
Optional parameters | Description |
---|---|
| A version of the api to call. If the parameter is set, it will overwrite the value stored in TomTom-Api-Version header. |
| Layer of the tile to be rendered. Default set to |
| A geopolitical view.
|
HTTP request headers
The following table lists HTTP request headers of particular interest to clients of the Map Display API Vector Tiles endpoint.
Required headers | Description |
---|---|
| Contains a version of the API to call. |
Optional headers | Description |
---|---|
Accept-Encoding | Contains the content encoding (usually a compression algorithm) that the
client is able to understand. |
If-None-Match | 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. |
Tracking-ID | Specifies an identifier for the request. It can be used to trace a call.
Value: |
Default view mapping
Default view is recognized based on the country the request came from.
Country | Default view |
---|---|
India |
|
Pakistan |
|
Argentina |
|
Bahrain, Kuwait, Oman, Qatar, Saudi Arabia, the United Arab Emirates |
|
Korea |
|
Serbia |
|
Malaysia |
|
Chile |
|
Algeria |
|
Philippines |
|
Brunei |
|
Taiwan |
|
Morocco |
|
Türkiye |
|
Israel |
|
Vietnam |
|
Others |
|
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
- These host names are:
- 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/maps/orbis/map-display/tile/1/0/0.pbf?key={Your_API_Key}
The second would be:
https://b.api.tomtom.com/maps/orbis/map-display/tile/1/0/0.pbf?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 Map Display API Vector service endpoint, for a single request, returns a binary response body which must be deserialized by client code generated by the Google Protocol Buffers compiler. The following response examples use a simple textual representation of the serialized binary vector tile data to illustrate the response content.
Response examples
Example
Whole world at zoom = 0
, basic layer.
Request | Response |
---|---|
https://api.tomtom.com/maps/orbis/map-display/tile/0/0/0.pbf?key={Your_API_Key} |
|
Error Response
The Map Display API Vector service endpoint 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 |
---|---|
| Main |
| One of a server-defined set of error codes. |
| 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 <detailedError>3 <code>BAD_REQUEST</code>4 <message>Invalid tile position arguments</message>5 </detailedError>6</errorResponse>
HTTP response codes
Code | Meaning & possible causes |
---|---|
200 | OK |
304 | Not Modified: The tile has not been modified. This code is
returned when the |
400 | Bad request: Probably malformed syntax.
|
403 | Forbidden:
|
429 | Too Many Requests: Too many requests were sent in a given amount of time for the supplied API Key. |
500 | Internal Server Error : There is a problem with the TomTom Orbis Maps Vector Tile service. |
503 | Service currently unavailable. |
HTTP response headers
The following data table lists HTTP response headers of particular interest to clients of the Map Display API Vector Tile service.
Header | Description |
---|---|
Access-Control-Allow-Origin | The Map Display API Vector Tiles endpoint allows cross-origin resource
sharing (CORS). |
Cache-Control | Contains directives for a caching mechanism. |
Content-Encoding | Indicates which encodings were applied to the response body. |
Content-Length | Contains information about the size of the response body. |
Content-Type | Indicates the media type of the resource returned. |
Date | Contains the date and time at which the message was originated. |
ETag | Contains an identifier for a specific version of resource. |
Expires | Contains the date after which the response is considered outdated. |
Transfer-Encoding | Specifies the form of encoding used to safely transfer the response to
the user. If this header is specified, the Content-Length header will be
absent. |
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. |