v16

latestOpenAPI 3.1.0MIT OR Apache-2.0raw.githubusercontent.com2026-08-0113826.6 KB
crate::srv

Render a static map image with optional vector overlays. See [our documentation](https://maplibre.org/martin/sources-styles/) for the supported overlay body -- a `GeoJSON` `FeatureCollection` with style properties on each feature.

An empty or missing body renders the base map alone.

post/style/{style_id}/static/{camera}/{size}.{format}

Path parameters

style_idstring required
camerastring required

lon,lat,zoom[@bearing[,pitch]] or minLon,minLat,maxLon,maxLat.

sizestring required

WIDTHxHEIGHT[@SCALEx] - e.g. 800x600 or 400x300@2x.

format'png' | 'jpg' | 'webp' required

Image format requested in the URL.

Output encoding. png, jpg, or webp (canonical names only; .jpeg is redirected to .jpg via [redirect_static_jpeg]).

Request body

type'FeatureCollection' required

"FeatureCollection" discriminator for the top-level body. A unit enum so any other type (a bare Feature, Geometry, or garbage) fails to deserialize with a clear serde error.

Example request

{
  "features": [
    {
      "properties": {
        "circle-color": "#285DAA",
        "circle-radius": 8,
        "fill-color": "#95BEFA",
        "line-cap": "round",
        "line-color": "#285DAA",
        "line-join": "round",
        "line-width": 2
      }
    }
  ]
}

Response

Rendered static map image