Add Layer Endpoint
const url = 'https://example.com/api/maps/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/layers';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"dataset_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","sort_order":0,"visible":true,"opacity":1,"paint":{},"layout":{},"display_name":"example","filter":["example"],"label_config":{},"popup_config":{"enabled":true,"expression":"example","visible_fields":["example"]},"style_config":{},"layer_type":"example","show_in_legend":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/maps/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/layers \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "dataset_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "sort_order": 0, "visible": true, "opacity": 1, "paint": {}, "layout": {}, "display_name": "example", "filter": [ "example" ], "label_config": {}, "popup_config": { "enabled": true, "expression": "example", "visible_fields": [ "example" ] }, "style_config": {}, "layer_type": "example", "show_in_legend": true }'Add a layer to a map.
Phase 280: declared on both slash variants directly so neither emits a
307. FastAPI’s default redirect_slashes builds a relative Location
header that resolves against the request’s Host header, leaking the
in-container api:8000 hostname through Vite’s dev proxy. The
canonical (OpenAPI-published) form is the no-slash sub-collection
convention from docs/api-style.md; the trailing-slash form is a
hidden alias for callers that send the slash.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Request Body required
Section titled “Request Body required ”object
Draw order (lower draws first)
Layer opacity 0.0-1.0
Per-layer popup configuration: enable/disable + custom title template
- ordered visible-fields allowlist. Persisted as JSONB on map_layers.
object
Whether to include in the map legend
Responses
Section titled “ Responses ”Successful Response
object
object
object
object
Per-layer popup configuration: enable/disable + custom title template
- ordered visible-fields allowlist. Persisted as JSONB on map_layers.
object
Example
{ "layer_type": "vector_geolens", "show_in_legend": true}Bad request — invalid payload
object
Example
{ "type": "about:blank"}Unauthorized — missing or invalid credentials
object
Example
{ "type": "about:blank"}Forbidden — caller lacks write access
object
Example
{ "type": "about:blank"}Not found
object
Example
{ "type": "about:blank"}Conflict — resource state prevents the operation
object
Example
{ "type": "about:blank"}Validation error
object
Example
{ "type": "about:blank"}Internal server error
object
Example
{ "type": "about:blank"}