# Map layer

This API lets you create or update map layers. This must be done before creating any map features that reference the layer.&#x20;

### Map layer data JSON

The defining data of the map layer is a json document consisting of the following data. Note that min/max bounds are provided in an *Interval* JSON document below of the form&#x20;

```json
{"min": 0, "max": 20}
```

The json document defining a map layer then contains the fields:

|                    |                 |                                    |
| ------------------ | --------------- | ---------------------------------- |
| `name`             | translated text | The name of the layer              |
| `coordinateSystem` | string          | Use `"EPSG_3857"`                  |
| `layerType`        | string          | Use `"TILE"`                       |
| `xBound`           | Interval        | Longitude bound                    |
| `yBound`           | Interval        | Latitude bound                     |
| `zoomBound`        | Interval        | E.g. `{"min": 0, "max": 20}`       |
| `extId`            | string \| null  | External ID of the map layer       |
| `mapLayerId`       | string          | Optional map layer id to overwrite |

## Create or update map layer

<mark style="color:green;">`POST`</mark> `https://www.talque.com/webhook/org/<org_id>/map/layer/create`

Creates or updates map layer. A valid map layer id must be supplied, typically you need one per exhibition hall of the venu. The layer ID can be reused for different org ids.

**Body**

| Name        | Type    | Description                                                  |
| ----------- | ------- | ------------------------------------------------------------ |
| `isPrimary` | string  | This map layer is the primary layer                          |
| `mapLayer`  | JSON    | [Map layer data](#map-layer-data-json)                       |
| `clearAll`  | boolean | Whether to delete all other map data, missing means `false`. |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "success": true,
  "isPrimary": "true",
  "mapLayer": { ... },
  "clearAll": false,
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://talque.gitbook.io/public/webhooks/map-features/map-layer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
