add_layer
Add a dataset to a map as a new vector layer with optional color styling and popup fields. Use it to visualize search results, returning the layer_id, applied style, and map URL.
Instructions
Add a dataset to a map as a new layer, optionally styled. Each new
layer is drawn beneath the map's existing layers and can't be reordered,
so add the layer you want on top first. Returns the new layer_id, the
style written (with category values or class breaks and their colours)
and the map's url.
style is one of:
{"type": "single", "color": "#3388ff"}{"type": "categories", "column", "colors"}: a colour per distinct value of a text, boolean or integer column (at most 100 values).{"type": "classes", "column", "method", "count", "colors"}: a colour per range of a numeric column.methodis equal_interval (default), quantile (always five classes, nocount), jenks or std_dev;countis 3-9 (default 5). Or give"breaks": [10, 50, 100]instead ofmethodandcount.colorsis optional: a ramp name (Set2 for categories and YlOrRd for classes by default; also Blues, Viridis, RdBu, Paired and the other ColorBrewer names) or a list of hex colours, one per value or class.popup_fieldsare column names shown, in order, when a feature is clicked. Needs amap_authorAPI key, which can change only the maps it created; a 401 or 403 means the server runs without one.
Args: map_id: A map this key created (from create_map). dataset_id: Dataset id (e.g. from search_datasets). style: Optional style, described above; omitted, the layer keeps the default style. popup_fields: Optional columns to show in the popup.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"map_id": "<map_id>",
"dataset_id": "<dataset_id>"
},
"name": "add_layer"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| style | No | ||
| map_id | Yes | ||
| dataset_id | Yes | ||
| popup_fields | No |