Static Maps API

Center-based image

Added in v4.2.0
GET http://localhost:3650/api/maps/{mapId}/static/{lon},{lat},{zoom}/{width}x{height}{scale}.{format}

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

Request

Path Parameters

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

Query Parameters

Parameters Type Description
path
string
Define path(s) to be drawn on top of the map. Can be used multiple times. See Static maps in MapTiler Server.
Match pattern: ((fill|stroke|width|shortest)\:[^\|]+\|)*((enc:.+)|((-?\d+\.?\d*,-?\d+\.?\d*\|)+(-?\d+\.?\d*,-?\d+\.?\d*)))
Added in v4.4.0
markers
string
Define marker(s) to be drawn on top of the map. Can be used multiple times. See Static maps in MapTiler Server.
Match pattern: ((icon|anchor|scale)\:[^\|]+\|)*((-?\d+\.?\d*,-?\d+\.?\d*(,[^\|]+)?\|)+(-?\d+\.?\d*,-?\d+\.?\d*(,[^\|]+)?))
Added in v4.4.0
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
Default: bottomright
Added in v4.4.0
shortest
boolean
Draw the shortest paths, allow to cross the dateline.
Default: false
Added in v4.4.0
Request example

  http://localhost:3650/api/maps/streets/static/6.0288,44.3408,3/400x300.png

Responses

Code Content Description
200 image/*
400

Out of bounds / Invalid format

404

The item does not exist

414

URI Too Long. Maximum allowed length is 8192 bytes.

Bounds-based image

Added in v4.2.0
GET http://localhost:3650/api/maps/{mapId}/static/{minx},{miny},{maxx},{maxy}/{width}x{height}{scale}.{format}

Generates a raster image based on the given bounds.

Request

Path Parameters

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

Query Parameters

Parameters Type Description
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.
Default: 0.1
Added in v4.4.0
path
string
Define path(s) to be drawn on top of the map. Can be used multiple times. See Static maps in MapTiler Server.
Match pattern: ((fill|stroke|width|shortest)\:[^\|]+\|)*((enc:.+)|((-?\d+\.?\d*,-?\d+\.?\d*\|)+(-?\d+\.?\d*,-?\d+\.?\d*)))
Added in v4.4.0
markers
string
Define marker(s) to be drawn on top of the map. Can be used multiple times. See Static maps in MapTiler Server.
Match pattern: ((icon|anchor|scale)\:[^\|]+\|)*((-?\d+\.?\d*,-?\d+\.?\d*(,[^\|]+)?\|)+(-?\d+\.?\d*,-?\d+\.?\d*(,[^\|]+)?))
Added in v4.4.0
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
Default: bottomright
Added in v4.4.0
shortest
boolean
Draw the shortest paths, allow to cross the dateline.
Default: false
Added in v4.4.0
Request example

  http://localhost:3650/api/maps/streets/static/-11.54,34.1,23.6,52.96/400x300.png

Responses

Code Content Description
200 image/*
400

Out of bounds / Invalid format

404

The item does not exist

414

URI Too Long. Maximum allowed length is 8192 bytes.

Auto-fitted image

Added in v4.4.0
GET http://localhost:3650/api/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

Path Parameters

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

Query Parameters

Parameters Type Description
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.
Default: 0.1
Added in v4.4.0
path
string
Define path(s) to be drawn on top of the map. Can be used multiple times. See Static maps in MapTiler Server.
Match pattern: ((fill|stroke|width|shortest)\:[^\|]+\|)*((enc:.+)|((-?\d+\.?\d*,-?\d+\.?\d*\|)+(-?\d+\.?\d*,-?\d+\.?\d*)))
Added in v4.4.0
markers
string
Define marker(s) to be drawn on top of the map. Can be used multiple times. See Static maps in MapTiler Server.
Match pattern: ((icon|anchor|scale)\:[^\|]+\|)*((-?\d+\.?\d*,-?\d+\.?\d*(,[^\|]+)?\|)+(-?\d+\.?\d*,-?\d+\.?\d*(,[^\|]+)?))
Added in v4.4.0
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
Default: bottomright
Added in v4.4.0
shortest
boolean
Draw the shortest paths, allow to cross the dateline.
Default: false
Added in v4.4.0
Request example

  http://localhost:3650/api/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

Responses

Code Content Description
200 image/*
400

Out of bounds / Invalid format

404

The item does not exist

414

URI Too Long. Maximum allowed length is 8192 bytes.

Using the OpenAPI Specification?
Get the openapi.yaml