Static maps API
Static maps API makes it possible to use our maps as non-interactive, non-zoomable images. Adding markers or lines to static maps is also supported.
How to use the API
- Directly
- With the Static maps Client JS library
Key
You need a MapTiler API key to use this service. Get it here and learn how to protect it.
Getting started
- Use our visual generator to test the API and quickly build your static map’s URL.
- See the static maps guide to learn how to configure static maps and see practical usage examples.
- Learn how to make a map non-interactive with MapTiler SDK JS.
Static maps API reference
Static maps
Center-based image
Generates a raster image based on the specified center and zoom level.
- Type: stringmap
Id requiredIdentifier of the map. See MapTiler Maps.
- Type: numberlonrequired
Longitude of the center of the image.
- Type: numberlatrequired
Latitude of the center of the image.
- Type: numberzoomrequired
Zoom level of the resulting image (can be fractional). (In the tile pyramid based on 512x512 tiles.)
- Type: integerwidthmin:1max:2048required
Width of the image in pixels.
- Type: integerheightmin:1max:2048required
Height of the image in pixels.
- enumscaleconst:@2x
Use "@2x" to get "retina"/HiDPI image.
values- @2x
- Type: string enumformatrequiredvalues
- png
- jpg
- webp
- Type: stringpath
Define path(s) to be drawn on top of the map. Can be used multiple times. See Static map with lines or polygons.
- Type: stringmarkers
Define marker(s) to be drawn on top of the map. Can be used multiple times. See Static map with markers.
- Type: booleanlatlng
Use [latitude, longitude] order for coordinates instead of [longitude, latitude].
- Type: string enumattribution
Changes the position of map attribution. If you disable the attribution make sure to display it in your application yourself (visibly).
values- bottomright
- bottomleft
- topleft
- topright
- false
- Type: stringfilldeprecated
Color to use as a fill when drawing polygons. Deprecated, use "path" instead.
- Type: stringstrokedeprecated
Color to use as a stroke when drawing polygons. Deprecated, use "path" instead.
- Type: numberwidthdeprecated
Width of the stroke line when drawing polygons (in pixels). Deprecated, use "path" instead.
- Type: stringencodedpathdeprecated
Path in Google Encoded Polyline Format. Deprecated, use "path" instead.
- Type: booleanshortest
Draw the shortest paths, allow to cross the dateline.
- image/*
- 400
Out of bounds / Invalid format / Invalid image size
- 403
Key is missing, invalid or restricted
- 404
The item does not exist
- 414
URI Too Long. Maximum allowed length is 8192 bytes.
curl 'https://api.maptiler.com/maps/streets-v4/static/1,1,1/1x1@2x.png?key=YOUR_SECRET_TOKEN'
@filenameBounds-based image
Generates a raster image based on the given bounds.
- Type: stringmap
Id requiredIdentifier of the map. See MapTiler Maps.
- Type: numberminxrequired
Longitude of the left (west) edge.
- Type: numberminyrequired
Latitude of the bottom (south) edge.
- Type: numbermaxxrequired
Longitude of the right (east) edge.
- Type: numbermaxyrequired
Latitude of the top (north) edge.
- Type: integerwidthmin:1max:2048required
Width of the image in pixels.
- Type: integerheightmin:1max:2048required
Height of the image in pixels.
- enumscaleconst:@2x
Use "@2x" to get "retina"/HiDPI image.
values- @2x
- Type: string enumformatrequiredvalues
- png
- jpg
- webp
- Type: numberpadding
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.
- Type: stringpath
Define path(s) to be drawn on top of the map. Can be used multiple times. See Static map with lines or polygons.
- Type: stringmarkers
Define marker(s) to be drawn on top of the map. Can be used multiple times. See Static map with markers.
- Type: booleanlatlng
Use [latitude, longitude] order for coordinates instead of [longitude, latitude].
- Type: string enumattribution
Changes the position of map attribution. If you disable the attribution make sure to display it in your application yourself (visibly).
values- bottomright
- bottomleft
- topleft
- topright
- false
- Type: stringfilldeprecated
Color to use as a fill when drawing polygons. Deprecated, use "path" instead.
- Type: stringstrokedeprecated
Color to use as a stroke when drawing polygons. Deprecated, use "path" instead.
- Type: numberwidthdeprecated
Width of the stroke line when drawing polygons (in pixels). Deprecated, use "path" instead.
- Type: stringencodedpathdeprecated
Path in Google Encoded Polyline Format. Deprecated, use "path" instead.
- Type: booleanshortest
Draw the shortest paths, allow to cross the dateline.
- image/*
- 400
Out of bounds / Invalid format / Invalid image size
- 403
Key is missing, invalid or restricted
- 404
The item does not exist
- 414
URI Too Long. Maximum allowed length is 8192 bytes.
curl 'https://api.maptiler.com/maps/streets-v4/static/1,1,1,1/1x1@2x.png?key=YOUR_SECRET_TOKEN'
@filenameAuto-fitted image
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.
- Type: stringmap
Id requiredIdentifier of the map. See MapTiler Maps.
- Type: integerwidthmin:1max:2048required
Width of the image in pixels.
- Type: integerheightmin:1max:2048required
Height of the image in pixels.
- enumscaleconst:@2x
Use "@2x" to get "retina"/HiDPI image.
values- @2x
- Type: string enumformatrequiredvalues
- png
- jpg
- webp
- Type: numberpadding
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.
- Type: stringpath
Define path(s) to be drawn on top of the map. Can be used multiple times. See Static map with lines or polygons.
- Type: stringmarkers
Define marker(s) to be drawn on top of the map. Can be used multiple times. See Static map with markers.
- Type: booleanlatlng
Use [latitude, longitude] order for coordinates instead of [longitude, latitude].
- Type: string enumattribution
Changes the position of map attribution. If you disable the attribution make sure to display it in your application yourself (visibly).
values- bottomright
- bottomleft
- topleft
- topright
- false
- Type: stringfilldeprecated
Color to use as a fill when drawing polygons. Deprecated, use "path" instead.
- Type: stringstrokedeprecated
Color to use as a stroke when drawing polygons. Deprecated, use "path" instead.
- Type: numberwidthdeprecated
Width of the stroke line when drawing polygons (in pixels). Deprecated, use "path" instead.
- Type: stringencodedpathdeprecated
Path in Google Encoded Polyline Format. Deprecated, use "path" instead.
- Type: booleanshortest
Draw the shortest paths, allow to cross the dateline.
- image/*
- 400
Out of bounds / Invalid format / Invalid image size
- 403
Key is missing, invalid or restricted
- 404
The item does not exist
- 414
URI Too Long. Maximum allowed length is 8192 bytes.
curl 'https://api.maptiler.com/maps/streets-v4/static/auto/1x1@2x.png?key=YOUR_SECRET_TOKEN'
@filename