Static Maps API

Center-based image

GET https://api.maptiler.com/maps/{mapId}/static/{lon},{lat},{zoom}/{width}x{height}{scale}.{format}

Generates a raster image based on the specified center and zoom level.

Request

Security: API Key

Path Parameters

Parameters Type Description
mapId string
Identifier of the map. See MapTiler Cloud Maps
Example: streets
lon number
Longitude of the center of the image.
lat number
Latitude of the center of the image.
zoom number
Zoom level of the resulting image (integer). (In the tile pyramid based on 512x512 tiles.)
width integer
Width of the image in pixels.
height integer
Height of the image in pixels.
scale string
Use "@2x" to get "retina"/HiDPI image.
Allowed values: @2x
format string
The value depends on the Map settings.
Allowed values: png jpg webp

Query Parameters

Parameters Type Description
attribution string
Changes the position of map attribution. If you disable the attribution make sure to display it in your application yourself (visibly).
Allowed values: bottomright bottomleft topleft topright false
Style: Comma separated values
latlng boolean
Use [latitude, longitude] order for coordinates instead of [longitude, latitude].
Style: Comma separated values
markers string
Define marker(s) to be drawn on top of the map. Can be used multiple times. See https://support.maptiler.com/i26-static-maps-for-your-web.
Style: Comma separated values
Match pattern: ((icon|anchor|scale)\:[^\|]+\|)*((-?\d+\.?\d*,-?\d+\.?\d*(,[^\|]+)?\|)+(-?\d+\.?\d*,-?\d+\.?\d*(,[^\|]+)?))
path string
Define path(s) to be drawn on top of the map. Can be used multiple times. See https://support.maptiler.com/i26-static-maps-for-your-web.
Style: Comma separated values
Match pattern: ((fill|stroke|width)\:[^\|]+\|)*((enc:.+)|((-?\d+\.?\d*,-?\d+\.?\d*\|)+(-?\d+\.?\d*,-?\d+\.?\d*)))
encodedpath string
Path in Google Encoded Polyline Format. Deprecated, use "path" instead.
Style: Comma separated values
fill string
Color to use as a fill when drawing polygons. Deprecated, use "path" instead.
Style: Comma separated values
stroke string
Color to use as a stroke when drawing polygons. Deprecated, use "path" instead.
Style: Comma separated values
width number
Width of the stroke line when drawing polygons (in pixels). Deprecated, use "path" instead.
Style: Comma separated values
Example requests

https://api.maptiler.com/maps/streets/static/6.0288,44.3408,3/400x300.png?key=YOUR_MAPTILER_API_KEY

Response

Code Content Description
200 image/*
400 Out of bounds / Invalid format
403 Key is missing, invalid or restricted
404 The item does not exist
414 URI Too Long. Maximum allowed length is 8192 bytes.

Bounds-based image

GET https://api.maptiler.com/maps/{mapId}/static/{minx},{miny},{maxx},{maxy}/{width}x{height}{scale}.{format}

Generates a raster image based on the given bounds. The resulting zoom level is chosen so that the whole bounds are always visible (the zoom level is integer, so a little more than the bounds is usually visible).

Request

Security: API Key

Path Parameters

Parameters Type Description
mapId string
Identifier of the map. See MapTiler Cloud Maps
Example: streets
minx number
Longitude of the left (west) edge.
miny number
Latitude of the bottom (south) edge.
maxx number
Longitude of the right (east) edge.
maxy number
Latitude of the top (north) edge.
width integer
Width of the image in pixels.
height integer
Height of the image in pixels.
scale string
Use "@2x" to get "retina"/HiDPI image.
Allowed values: @2x
format string
The value depends on the Map settings.
Allowed values: png jpg webp

Query Parameters

Parameters Type Description
attribution string
Changes the position of map attribution. If you disable the attribution make sure to display it in your application yourself (visibly).
Allowed values: bottomright bottomleft topleft topright false
Style: Comma separated values
latlng boolean
Use [latitude, longitude] order for coordinates instead of [longitude, latitude].
Style: Comma separated values
markers string
Define marker(s) to be drawn on top of the map. Can be used multiple times. See https://support.maptiler.com/i26-static-maps-for-your-web.
Style: Comma separated values
Match pattern: ((icon|anchor|scale)\:[^\|]+\|)*((-?\d+\.?\d*,-?\d+\.?\d*(,[^\|]+)?\|)+(-?\d+\.?\d*,-?\d+\.?\d*(,[^\|]+)?))
padding number
Ensures the autofitted bounds or features are comfortably visible in the resulting area. E.g. use 0.1 to add 10% margin (at least) of the size to each side.
Style: Comma separated values
path string
Define path(s) to be drawn on top of the map. Can be used multiple times. See https://support.maptiler.com/i26-static-maps-for-your-web.
Style: Comma separated values
Match pattern: ((fill|stroke|width)\:[^\|]+\|)*((enc:.+)|((-?\d+\.?\d*,-?\d+\.?\d*\|)+(-?\d+\.?\d*,-?\d+\.?\d*)))
encodedpath string
Path in Google Encoded Polyline Format. Deprecated, use "path" instead.
Style: Comma separated values
fill string
Color to use as a fill when drawing polygons. Deprecated, use "path" instead.
Style: Comma separated values
stroke string
Color to use as a stroke when drawing polygons. Deprecated, use "path" instead.
Style: Comma separated values
width number
Width of the stroke line when drawing polygons (in pixels). Deprecated, use "path" instead.
Style: Comma separated values
Example requests

https://api.maptiler.com/maps/streets/static/-11.54,34.1,23.6,52.96/400x300.png?key=YOUR_MAPTILER_API_KEY

Response

Code Content Description
200 image/*
400 Out of bounds / Invalid format
403 Key is missing, invalid or restricted
404 The item does not exist
414 URI Too Long. Maximum allowed length is 8192 bytes.

Auto-fitted image

GET https://api.maptiler.com/maps/{mapId}/static/auto/{width}x{height}{scale}.{format}

Generates a raster image based on the given features. The area is calculated so that all the paths and markers given in query are visible.

Request

Security: API Key

Path Parameters

Parameters Type Description
mapId string
Identifier of the map. See MapTiler Cloud Maps
Example: streets
width integer
Width of the image in pixels.
height integer
Height of the image in pixels.
scale string
Use "@2x" to get "retina"/HiDPI image.
Allowed values: @2x
format string
The value depends on the Map settings.
Allowed values: png jpg webp

Query Parameters

Parameters Type Description
attribution string
Changes the position of map attribution. If you disable the attribution make sure to display it in your application yourself (visibly).
Allowed values: bottomright bottomleft topleft topright false
Style: Comma separated values
latlng boolean
Use [latitude, longitude] order for coordinates instead of [longitude, latitude].
Style: Comma separated values
markers string
Define marker(s) to be drawn on top of the map. Can be used multiple times. See https://support.maptiler.com/i26-static-maps-for-your-web.
Style: Comma separated values
Match pattern: ((icon|anchor|scale)\:[^\|]+\|)*((-?\d+\.?\d*,-?\d+\.?\d*(,[^\|]+)?\|)+(-?\d+\.?\d*,-?\d+\.?\d*(,[^\|]+)?))
padding number
Ensures the autofitted bounds or features are comfortably visible in the resulting area. E.g. use 0.1 to add 10% margin (at least) of the size to each side.
Style: Comma separated values
path string
Define path(s) to be drawn on top of the map. Can be used multiple times. See https://support.maptiler.com/i26-static-maps-for-your-web.
Style: Comma separated values
Match pattern: ((fill|stroke|width)\:[^\|]+\|)*((enc:.+)|((-?\d+\.?\d*,-?\d+\.?\d*\|)+(-?\d+\.?\d*,-?\d+\.?\d*)))
encodedpath string
Path in Google Encoded Polyline Format. Deprecated, use "path" instead.
Style: Comma separated values
fill string
Color to use as a fill when drawing polygons. Deprecated, use "path" instead.
Style: Comma separated values
stroke string
Color to use as a stroke when drawing polygons. Deprecated, use "path" instead.
Style: Comma separated values
width number
Width of the stroke line when drawing polygons (in pixels). Deprecated, use "path" instead.
Style: Comma separated values
Example requests

https://api.maptiler.com/maps/streets/static/auto/400x300.png?path=stroke:green|width:3|fill:none|5.9,45.8|5.9,47.8|10.5,47.8|10.5,45.8|5.9,45.8&key=YOUR_MAPTILER_API_KEY

Response

Code Content Description
200 image/*
400 Out of bounds / Invalid format
403 Key is missing, invalid or restricted
404 The item does not exist
414 URI Too Long. Maximum allowed length is 8192 bytes.