Mapbox Maps Static Images Get Static Map
1 credits/call
ae_mapbox_maps_static_images_get_static_map
Generate a static map image from a custom style, with support for markers, paths, and GeoJSON overlays.
1 credits/call
Pricing
1 credits/call
| Condition | Charge |
|---|---|
| Each call | 1 credits/call |
Parameters
Optional parameters use the platform defaults when omitted.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
logo | boolean | No | Controls whether there is a Mapbox logo on the image. Defaults to true. | — |
overlay | string | Yes | One or more comma-separated features that can be applied on top of the map at request time. Format can be a mix of geojson, marker, or path. | — |
padding | string | No | Denotes the minimum padding per side of the image. Can only be used with auto or bbox. Accepts 1-4 integers without units. | — |
addlayer | object | No | Adds a Mapbox style layer to the map's style at render time. Can be combined with before_layer. | — |
layer_id | string | Conditional | Denotes the layer in the style that the filter specified in setfilter is applied to. | — |
location | string | Yes | Map position: a literal coordinate string lon,lat,zoom[,bearing[,pitch]], a bracketed bounding box [minLon,minLat,maxLon,maxLat], or auto. Examples: -122.4241,37.78,15.25 or [-77.043686,38.892035,-77.028923,38.904192]. Do not pass the placeholders bbox or lon,lat,zoom,bearing,pitch. Longitude -180..180, latitude -85.0511..85.0511, zoom 0..22, bearing 0..360, pitch 0..60. auto fits an overlay and requires an overlay. | — |
style_id | string | Yes | The ID of the style from which to create a static map. | — |
username | string | Yes | The username of the account to which the style belongs. | — |
setfilter | string | No | JSON-encoded Mapbox filter expression as a string, for compatibility with the current Wrapper. Example: ["==","name_en","Canada"]. Serialize the expression with JSON.stringify before passing setfilter; do not pass a JSON array and do not URL-encode it manually. Requires layer_id identifying an existing style layer. Cannot be combined with addlayer. | — |
dimensions | string | Yes | Image dimensions in format widthxheight. Width and height must be between 1 and 1280 pixels. | — |
attribution | boolean | No | Controls whether there is attribution on the image. Defaults to true. | — |
before_layer | string | No | Controls where the overlay is inserted in the style. All overlays will be inserted before the specified layer. | — |
Invocation example
Copy the request and explore its response example.
POST
/agent-api/v1/tool/executeX-Api-KeyRequest coderequest.sh
curl --request POST \
--url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_mapbox_maps_static_images_get_static_map' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"attribution": true,
"dimensions": "1280x894",
"location": "21.3,54.3,6",
"logo": false,
"overlay": "{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[21.0,54.0],[21.01,54.0]]},\"properties\":{\"stroke\":\"#000000\",\"stroke-opacity\":0,\"stroke-width\":0}}",
"style_id": "light-v11",
"username": "mapbox"
}
}'Response exampleresponse.json
{
"message": "{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[21.0,54.0],[21.01,54.0]]},\"properties\":{\"stroke\":\"#000000\",\"stroke-opacity\":0,\"stroke-width\":0}} is not a supported overlay method"
}

