Static Maps API

Static Maps API reference

Scalar API Reference
v4.8.0
OpenAPI 3.1.0

MapTiler Server API

Server:http://localhost:3650/api

MapTiler Server API

Client Libraries

Static maps

Center-based image

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

Path Parameters
  • mapId
    Type: string
    required

    Identifier of the map. See MapTiler Server Maps http://localhost:3650/admin/.

  • lon
    Type: number
    required

    Longitude of the center of the image.

  • lat
    Type: number
    required

    Latitude of the center of the image.

  • zoom
    Type: number
    required

    Zoom level of the resulting image (can be fractional). (In the tile pyramid based on 512x512 tiles.)

  • width
    Type: integer
    required

    Width of the image in pixels.

  • height
    Type: integer
    required

    Height of the image in pixels.

  • scale
    enum
    const:  
    @2x

    Use "@2x" to get "retina"/HiDPI image.

    values
    • @2x
  • format
    Type: string enum
    required

    The value depends on the Map settings.

    values
    • png
    • jpg
    • webp
Query Parameters
  • path
    Type: string

    Define path(s) to be drawn on top of the map. Can be used multiple times. See Static maps in MapTiler Server.

  • markers
    Type: string

    Define marker(s) to be drawn on top of the map. Can be used multiple times. See Static maps in MapTiler Server.

  • attribution
    Type: string enum

    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
  • shortest
    Type: boolean

    Draw the shortest paths, allow to cross the dateline.

Responses
  • image/*
  • 400

    Out of bounds / Invalid format

  • 404

    The item does not exist

  • 414

    URI Too Long. Maximum allowed length is 8192 bytes.

Request Example for get/maps/{mapId}/static/{lon},{lat},{zoom}/{width}x{height}{scale}.{format}
curl http://localhost:3650/api/maps/streets/static/1,1,1/1x1@2x.png
@filename

Bounds-based image

Generates a raster image based on the given bounds.

Path Parameters
  • mapId
    Type: string
    required

    Identifier of the map. See MapTiler Server Maps http://localhost:3650/admin/.

  • minx
    Type: number
    required

    Longitude of the left (west) edge.

  • miny
    Type: number
    required

    Latitude of the bottom (south) edge.

  • maxx
    Type: number
    required

    Longitude of the right (east) edge.

  • maxy
    Type: number
    required

    Latitude of the top (north) edge.

  • width
    Type: integer
    required

    Width of the image in pixels.

  • height
    Type: integer
    required

    Height of the image in pixels.

  • scale
    enum
    const:  
    @2x

    Use "@2x" to get "retina"/HiDPI image.

    values
    • @2x
  • format
    Type: string enum
    required

    The value depends on the Map settings.

    values
    • png
    • jpg
    • webp
Query Parameters
  • padding
    Type: 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.

  • path
    Type: string

    Define path(s) to be drawn on top of the map. Can be used multiple times. See Static maps in MapTiler Server.

  • markers
    Type: string

    Define marker(s) to be drawn on top of the map. Can be used multiple times. See Static maps in MapTiler Server.

  • attribution
    Type: string enum

    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
  • shortest
    Type: boolean

    Draw the shortest paths, allow to cross the dateline.

Responses
  • image/*
  • 400

    Out of bounds / Invalid format

  • 404

    The item does not exist

  • 414

    URI Too Long. Maximum allowed length is 8192 bytes.

Request Example for get/maps/{mapId}/static/{minx},{miny},{maxx},{maxy}/{width}x{height}{scale}.{format}
curl http://localhost:3650/api/maps/streets/static/1,1,1,1/1x1@2x.png
@filename

Auto-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.

Path Parameters
  • mapId
    Type: string
    required

    Identifier of the map. See MapTiler Server Maps http://localhost:3650/admin/.

  • width
    Type: integer
    required

    Width of the image in pixels.

  • height
    Type: integer
    required

    Height of the image in pixels.

  • scale
    enum
    const:  
    @2x

    Use "@2x" to get "retina"/HiDPI image.

    values
    • @2x
  • format
    Type: string enum
    required

    The value depends on the Map settings.

    values
    • png
    • jpg
    • webp
Query Parameters
  • padding
    Type: 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.

  • path
    Type: string

    Define path(s) to be drawn on top of the map. Can be used multiple times. See Static maps in MapTiler Server.

  • markers
    Type: string

    Define marker(s) to be drawn on top of the map. Can be used multiple times. See Static maps in MapTiler Server.

  • attribution
    Type: string enum

    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
  • shortest
    Type: boolean

    Draw the shortest paths, allow to cross the dateline.

Responses
  • image/*
  • 400

    Out of bounds / Invalid format

  • 404

    The item does not exist

  • 414

    URI Too Long. Maximum allowed length is 8192 bytes.

Request Example for get/maps/{mapId}/static/auto/{width}x{height}{scale}.{format}
curl http://localhost:3650/api/maps/streets/static/auto/1x1@2x.png
@filename
Using the OpenAPI Specification?
Get the openapi.yaml
Was this helpful?
MapTiler Server API
Static Maps API | MapTiler Server API
Static Maps API