Legends are visual guides that explain the correspondence between colors and the values or categories they represent. Legends can be configured in settings.
You can enable legends for layers that have a dynamic color configuration (e.g. bound to a field). Multiple legends can be configured but only one legend will be displayed at a time. This is useful to show different legends at different zoom levels.
By default the name of the color field is used as the legend title. You can change that in the advanced mode of the legend by setting the title field:
[
{
"layer": "f30042ef-d7e8-4d97-a53c-b1efd5eee90c",
"title": "Current Status"
}
]
You can add a description for the legend in the advanced mode. The description will be displayed right below the title.
[
{
"layer": "f30042ef-d7e8-4d97-a53c-b1efd5eee90c",
"title": "Current Status",
"description": "Based on the last hour"
}
]
You can create a custom legend by defining a list of colors and labels in the advanced mode of the legend.
[
{
"layer": "f30042ef-d7e8-4d97-a53c-b1efd5eee90c",
"title": "Status",
"items": [
{
"color": "#3b9932",
"label": "OK"
},
{
"color": "#fcca00",
"label": "Warning"
},
{
"color": "#e41a0d",
"label": "Risk"
},
{
"color": "#808080",
"label": "Offline"
}
]
}
]