> For the complete documentation index, see [llms.txt](https://talque.gitbook.io/public/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://talque.gitbook.io/public/webhooks/map-features/map-features.md). Agents can also search and read this documentation through its [MCP server](https://talque.gitbook.io/public/~gitbook/mcp).

# Map features

This API lets you create or update map features, that is, geometric shapes that are drawn on top of the background map.

### Map feature data JSON

The defining data of a map feature is a json document with the fields

|              |                 |                                                                       |
| ------------ | --------------- | --------------------------------------------------------------------- |
| name         | translated text | Name of the map feature                                               |
| geoJson      | JSON            | GeoJSON feature                                                       |
| convex       | number\[]\[]    | Convex hull of the feature                                            |
| booth        | translated text | Name of the booth                                                     |
| hall         | translated text | Name of the hall                                                      |
| mapFeatureId | string          | Unique ID of the feature                                              |
| extId        | string          | External ID of the feature, alternative to `mapFeatureId`             |
| interactions | JSON\[]         | E.g. what happens when clicking on the feature. See below for details |

### Interactions

Users expect e.g. that clicking on a vendor booth opens the connected vendor profile. This data is added by the interaction json document. This has the form

```json
{
  "gesture": "CLICK",
  "action": { ... }
}
```

Below we list the different types of actions. The primary (first) interaction also determines how the feature is rendered on the map, e.g. `SwitchLayerMapAction` is rendered as a venue hall.

#### Switch layer action (hall)

```
{
    "mapActionType": "SwitchLayerMapAction",
    "layers": ["vGa8MD9CrI07H7tViVnu"]
}
```

#### Open detail action

Interacting with the feature (e.g. click) will open the detailed profile of a vendor, or the program of a stage.&#x20;

```
{
    "mapActionType": "DetailMapAction",
    "vendors": ["asbZjhnPsFAlMsOKZs0D"],
    "rooms": [],
}
```

#### External URL action

This feature opens an external URL in a new browser tab

```
{
    "mapActionType": "UrlMapAction",
    "url": "https://www.talque.com"
```

## Create or update map features

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

Creates or updates map features

**Body**

| Name          | Type    | Description                                                          |
| ------------- | ------- | -------------------------------------------------------------------- |
| `bounds`      | string  | Whether to change the layer bounds (`IGNORE`, `EXPAND`, `OVERWRITE`) |
| `mapLayerId`  | string  | Layer that the features belong to                                    |
| `extId`       | string  | External ID of the layer, alternative to `mapLayerId`                |
| `mapFeatures` | JSON\[] | The [map features](#map-feature-data-json) to create or update       |

**Response**

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

```json
{
  "success": true,
  "mapLayer": { ... },
  "mapFeatures": [
    { ... },
    { ... }
  ]
}
```

{% endtab %}

{% tab title="400" %}

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

{% endtab %}
{% endtabs %}
