Static Image
Purpose
The Static Image service renders a user-defined, rectangular image containing a map section. A user can select one of 23 zoom levels ranging from 0
to 22
for it.
Run this endpoint
You can easily run this and other endpoints. Go to the TomTom API Explorer page and follow the directions.
Layers and styles
A user can select from predefined layers and styles for the map. The Static Image service supports the following layers:
- basic layer
- hybrid layer
- labels layer
Each layer can be served in two different styles: main style and night style.
Layers
Basic
Contains full map data, i.e., polygons, roads, borders, and labels.
Hybrid
Contains borders, roads, and labels (all the map features, except geographic polygons). It can be overlaid on another map layer (such as satellite imagery) in order to produce a hybrid map.
Labels
Only provides label information (the same as the basic map layer). It can be used in situations where traffic tubes or other overlaid information cover labels of the base map layer. The labels are precisely placed in order to align with the labels on the basic layer. Because overlaying requires transparency, all overlay images must be requested in png format.
Styles
Styles define two colour schemes:
main : Defines the general full-colour scheme with default TomTom colours.
night : Defines the modification of the main theme, it is changed to be less invasive than main while using it at night.
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}/staticimage?key={Your_API_Key}¢er={centerPointCoords}&bbox={boundingBox}&zoom={zoom}&width={width}&height={height}&format={format}&layer={layer}&style={style}&view={geopoliticalView}
Examples
https://api.tomtom.com/map/1/staticimage?key={Your_API_Key}&zoom=9¢er=13.567893,46.112341&format=jpg&layer=basic&style=main&width=1305&height=748&view=Unified&language=en-GB
https://api.tomtom.com/map/1/staticimage?key={Your_API_Key}&zoom=9&bbox=23.355233,55.982261,24.980233,56.526017&format=png&layer=labels&style=night&view=IN&language=en-GB
curl command format
curl 'https://api.tomtom.com/map/1/staticimage?key={Your_API_Key}&zoom=9¢er=13.567893,46.112341&format=jpg&layer=basic&style=main&width=1305&height=748 &view=Unified &language=en-GB'
Request parameters
The following data table describes the parameters that can be used in a request. Required parameters must be used or the call will fail.
Important: the center
parameter and the bbox
parameter are mutually exclusive. Either of these parameters are required in a request, but not both. If you use both of these parameters in the same request, the call will fail with a 400 error. See the Mutually exclusive parameters section in the following table for more information.
Required parameters | Description |
---|---|
string | The base URL for calling TomTom services. Value: |
string | The version of the service to call. Value: The current version is |
string | The Authorization key for access to the API. Value: Your valid |
Mutually exclusive parameters | Description |
---|---|
float | Center point coordinates. Usage of Value:
|
float | Bounding box. Usage of Values:
|
Optional parameters | Description |
---|---|
string | Default value: Other values: |
string | The map style to be returned. Usage of a value outside of the given set
will result in the server sending a HTTP Default value: Other value: |
string | The image format to be returned. Usage of a value outside of the given
set will result in the server sending a HTTP Default value: Other values: |
integer | The desired zoom level of the map. Zoom must be within the range of:
Default value: Other values: |
integer | The width of the resulting image, in pixels. Width must be a positive
integer in the range of Default value: Other values: A positive integer within the range of:
|
integer | The height of the resulting image, in pixels. Height must be a positive
integer in the range of Default value: Other values: A positive integer within the range of:
|
string | The geopolitical view. Usage of a value outside of the given set will
result in the server sending a HTTP 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. |
- Only available under kr-api.tomtom.com , see Available region specific contents.
Request headers
The following table lists HTTP request headers of particular interest to clients of the Maps Static Image API endpoint. Note: There are no required headers in this endpoint.
Optional headers | Description |
---|---|
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 the 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.
Allowed zoom level / bbox combinations
Zoom level | Max longitude difference | Max latitude difference |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Examples
https://api.tomtom.com/map/1/staticimage?key={Your_API_Key}&zoom=5&bbox=-180,-85,0,0&format=jpg&layer=basic&style=main&view=Unified
https://api.tomtom.com/map/1/staticimage?key={Your_API_Key}&zoom=5&bbox=-180,-85,1,0&format=jpg&layer=basic&style=main&view=Unified
Response data
Error response
The Map Display API Static Map service for an invalid request returns a response body in plain text or JSON format. The plain text 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.
Plain text format
Bad request
Error response field structure
Field | Description |
---|---|
object | Main |
string | One of a server-defined set of error codes. |
string | A human-readable description of the error code. |
array | Optional field. Details about an error. Contains objects which have the following properties:
|
string | Name of an invalid parameter. |
Error response example
1{2 "detailedError": {3 "code": "BAD_REQUEST",4 "message": "Bad request",5 "details": [6 {7 "code": "OUT_OF_RANGE_VALUE",8 "message": "Invalid zoom 23. Expected zoom in range 0-22.",9 "target": "zoom"10 },11 {12 "code": "INVALID_PARAM",13 "message": "Invalid format png2. Supported formats are: png, jpg, jpeg.",14 "target": "format"15 }16 ]17 }18}
Response codes
Code | Meaning and possible causes |
---|---|
| OK |
| Bad Request : Received by the interface, but there is an error in the request, such as:
This HTTP response code is returned if the required parameters of the request were malformed. A detailed exception explanation is returned in a response in the form of a Service Exception Report. |
| Forbidden :
|
| 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 Static Map Service. |
| Service currently unavailable |
Response headers
The following data table lists HTTP response headers of particular interest to clients of the Maps Static Image API endpoint.
Header | Description |
---|---|
The Static Image Service allows cross-origin resource sharing (CORS).
Value: | |
Contains information about the size of the response body. Value: | |
Indicates the media type of the resource returned. Values: | |
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. |