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¶
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¶
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¶
Expected response:
Next steps¶
- Confirm each parameter before generating requests dynamically.
- Read styles and assets if the render is missing labels or icons.
- Read projections and BBOX if the image covers the wrong place.
- Add timeouts and explicit error handling before production use.