# LegendItem

***

A legend item, which often represents a sub-class of features in a\
layer in the case of categorical or classed layers.

## Properties

### title

> **title**: `string` | `string`\[]

The title of the legend item.

***

### titleDependsOnZoom

> **titleDependsOnZoom**: `boolean`

Whether the title depends on the zoom level or not. If it does, you\
need to call [\`getLegendItem\`](/js-sdk-api-reference/layers/layerscontroller.md#getlegenditem) when the zoom level changes.

Note that as the zoom level changes, the [\`onLegendItemChange\`](/js-sdk-api-reference/layers/layerscontroller.md#onlegenditemchange) handler\
will not be called, so you need to call [\`getLegendItem\`](/js-sdk-api-reference/layers/layerscontroller.md#getlegenditem) yourself.

***

### visible

> **visible**: `boolean`

Whether the legend item is visible or not.

***

### id

> **id**: `string`

The id of the legend item.

***

### layerId

> **layerId**: `string`

The id of the layer the legend item belongs to.


---

# 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://developers.felt.com/js-sdk-api-reference/layers/legenditem.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.
