Skip to content

Render a map image

You need an issued WMS-VT API key and a MapLibre-compatible style URL whose referenced assets are reachable by the rendering service.

1. Keep credentials outside the command

export WMSVT_API_KEY='issued-by-wms-vt'
export STYLE_URL='https://maps.example.com/style.json'

If the style provider requires a key, follow that provider's rules. Avoid storing either credential in shell history, source control, screenshots, or client-side website code.

2. Send the request

curl --fail-with-body --get \
  'https://api.wmsvt.com/api/v1.0.2/queued-wms' \
  --data-urlencode "key=$WMSVT_API_KEY" \
  --data-urlencode 'bbox=238138.090518,6238073.596726,264358.090923,6264293.626065' \
  --data-urlencode 'width=1600' \
  --data-urlencode 'height=1600' \
  --data-urlencode 'dpi=96' \
  --data-urlencode "styleurl=$STYLE_URL" \
  --output map.png

--data-urlencode is important for styleurl, which commonly contains its own query string.

3. Inspect the result

file map.png

A successful render is an image response. A validation or render failure is a JSON error response and, with --fail-with-body, causes curl to return a non-zero exit status.

4. Check service health separately

curl --fail 'https://api.wmsvt.com/api/v1/health'

Expected response:

{"message":"healthy"}

Next steps